[Issue 18326] Reals greater than double.max are printed as infinity

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 11 10:27:23 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=18326

Tiberiu Lepadatu <tiberiulepadatu14 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tiberiulepadatu14 at gmail.com

--- Comment #1 from Tiberiu Lepadatu <tiberiulepadatu14 at gmail.com> ---
(In reply to Răzvan Ștefănescu from comment #0)
> And reals smaller than double.min_normal * double.epsilon are printed as 0.
> 
> real rmax = +0x1.fffffffffffffffep+16383L
> real rdbl = double.max;
> rdbl *= 2;
> real rmin = real.min_normal;
> 
> writefln("%a %a %a", rmax, rdbl, rmin)
> //outputs inf inf 0x0.0000000000000p+0
> 
> Probably because formatting functions in phobos use 64 bit snprintf from MS
> Runtime which doesn't support reals.
> 
> Related: https://issues.dlang.org/show_bug.cgi?id=9297

On Ubuntu it outputs:
0xf.fffffffffffffffp+16380 0xf.ffffffffffff8p+1021 0x8p-16385.

--


More information about the Digitalmars-d-bugs mailing list