Re: IEEE-FP 0.5.3
- From: "David N. Williams" <williams@xxxxxxxxx>
- Date: Thu, 27 Aug 2009 18:00:27 -0400
Marcel Hendrix wrote:
> Andrew Haley <andrew29@xxxxxxxxxxxxxxxxxxxxxxx> writes Re: IEEE-FP 0.5.3
>
>> Marcel Hendrix <mhx@xxxxxx> wrote:
> [.. D>F ..]
>> I think especially the rounding part of this definition deviates
>> wildly from common implementation practice (even gForth is using
>> the fild instruction here) and as such will cause chaos.
>
>> I can't see the difference from fild. Can you be more specific,
>> please?
>
> Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
> Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> Type `bye' to exit
>
> cr 9223371972430266300. 2dup d. d>f f>d d.
> 9223371972430266300 9223371972430266368 ok
>
> cr 9223371972430266300. 2dup d. d>f f.
> 9223371972430266300 9223371972430270000. ok
>
> A positive double number is transformed into a float that is nowhere
> near "correctly rounded."
Actually, I think it's okay:
19 set-precision ok
cr 9223371972430266300. 2dup d. d>f f.
9223371972430266300 9223371972430266368. ok
I actually verified this by doing it all in hex and rounding by
hand.
-- David
.
- References:
- Re: IEEE-FP 0.5.3
- From: Andrew Haley
- Re: IEEE-FP 0.5.3
- From: Marcel Hendrix
- Re: IEEE-FP 0.5.3
- Prev by Date: Re: IEEE-FP 0.5.3
- Next by Date: Re: IEEE-FP 0.5.3
- Previous by thread: Re: IEEE-FP 0.5.3
- Next by thread: Re: IEEE-FP 0.5.3
- Index(es):
Relevant Pages
|