wrong rounding

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 2 07:45:12 PDT 2015


On 6/2/15 5:53 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" wrote:
> On Monday, 1 June 2015 at 22:24:31 UTC, John Colvin wrote:
>> Nonetheless, surely in this case the values should be the same
>> regardless of the integer target type, no?
>
> Not sure... the spec says that the compiler is allowed to do
> intermediate computations at higher precision, but it doesn't say it is
> required to. So, strictly speaking, its at the compiler's discretion to
> use higher precision when rounding to `int` than when rounding to
> `ulong`...

Right, but there is a difference between ulong and long. These should be 
the same exact code.

Something definitely isn't right.

-Steve


More information about the Digitalmars-d mailing list