Less-than-optimal decimal real literal conversion to x86 extended floats

pineapple via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 21 18:00:49 PST 2017


On Sunday, 22 January 2017 at 01:54:59 UTC, pineapple wrote:
> When you write `real x = 0.0005;` x in fact represets a value 
> of about 
> 0.000500000000000000000032187251995663412884596255025826394. 
> This is a about 3.2 * 10^-23 more than 0.0005.
>
> The output of my function in this case was about 
> 0.000499999999999999999979247692792269641692826098733348771. 
> This is a about 2.1 * 10^-23 less than 0.0005.

I might have added, for clarity, that there are no representable 
values in between these two, 0.0005 or otherwise.


More information about the Digitalmars-d mailing list