[Issue 366] Adding trailing zeros to a real literal makes it smaller!

Don Clugston dac at nospam.com.au
Mon Sep 25 23:33:24 PDT 2006


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=366
> 
> 
> bugzilla at digitalmars.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |INVALID
> 
> 
> 
> 
> ------- Comment #1 from bugzilla at digitalmars.com  2006-09-25 13:40 -------
> Conversion from decimal to binary is done using "round to nearest", not
> "truncate towards zero". Round to nearest will 50% of the time result in larger
> numbers than truncating towards 0. Adding 0's to the literal is the same as
> truncate towards zero.

In fact, adding ANY digits to the literal makes it smaller. This one 
also fails:

static assert(
0.6600_0112_2408_4800_3227e-8L <=
0.6600_0112_2408_4800_3227999999999999999999999999999999e-8L);





More information about the Digitalmars-d-bugs mailing list