Re: Fastcode RoundTo replacement
- From: "John Herbster" <herb-sci1_AT_sbcglobal.net>
- Date: Sat, 29 Oct 2005 14:35:42 -0500
"Max" wrote
> there are offered these replacements in RoundToEX_JOH.pas:
> ... Which is recommended?
The original RoundTo() that came with D6 or D7 has
problems. Same are noted in still open QualityCentral
report #8070.
Perhaps, stating the definition of what the RoundTo function
is supposed to be doing (either by words or code) would be
a good place to start.
Beyond, what was originally noted in the #8070 report,
note that the ADigit in
function RoundTo
(const AValue: Double; const ADigit: TRoundToRange): Double;
which is defined as
type TRoundToRange = -37..37;
was probably meant to be
type TRoundToRange = -27..27;
because 10 raised to the 37th power cannot be exactly
represented in the data type extended. The highest that
can exactly be represented is 10 raised to the 27th power.
Regards, JohnH
.
- Follow-Ups:
- Re: Fastcode RoundTo replacement
- From: Max
- Re: Fastcode RoundTo replacement
- Prev by Date: Re: memorymanager/fastmm question/suggestion
- Next by Date: Re: Performance Bottlenecks
- Previous by thread: Re: Fastcode RoundTo replacement
- Next by thread: Re: Fastcode RoundTo replacement
- Index(es):
Relevant Pages
|