Re: FastCode RoundToEx



Dennis wrote:

Hi

Claim Number 3

"The result of RoundToEx(InpVal,-2) will be
RoundToEX_Ref = + 0.04999 99999 99999 99999 72894 94568 78623
89149 81367 99782 51457 21435 54687 5
which is actually further away from the rational 5/100 value than the
InpVal is away from the rational value.
"

RoundTo and RoundToEx is supposed to return 5 if called with
RoundTo(5, -2)

It is easily verified that they both do so.

How do you verify that? Dennis, whatever you say, you don't seem to
have any idea how floating point numbers are stored. Anyone with
knowledge of how they are stored can tell you you are wrong.

If you use FloatToStr or Writeln or any other Extended-to-text
conversion, the conversion will lose some of the insignificant bits,
i.e. perform some kind of rounding or truncation. The real number
stored in the Extended is VERY CLOSE TO 0.05, but NEVER EXACTLY 0.05.

--
Rudy Velthuis [TeamB] http://www.teamb.com

"It is better to be quotable than to be honest." -- Tom Stoppard
.



Relevant Pages

  • Re: WP 6.x to Word conversion - bad results
    ... design-time. ... Dennis ... >> those) with a very ligh MN state seal behind text. ... >> problem is that upon conversion, ...
    (microsoft.public.word.conversions)
  • Re: ASC save stripping characters
    ... G'day "dennis", ... conversion, then search for and replace the ### with ASC 167. ... Steve Hudson - Word Heretic ...
    (microsoft.public.word.docmanagement)
  • Re: doubles and floats
    ... "It requires an implicit conversion" ... Dennis JD Myrén ... > It requires an implicit conversion because double to float conversion is ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: WP 6.x to Word conversion - bad results
    ... and any further insights or ... > conversion. ... Is recreating ...
    (microsoft.public.word.conversions)
  • Re: Fastcode RoundTo B&V 0.1
    ... For Dennis and other programmers interested in rounding, ... This is yet another version of routines for replacing Math ... unit's RoundTo() and SimpleRoundTo function. ... comment in QC report #8070. ...
    (borland.public.delphi.language.basm)