wrong rounding

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 1 15:40:21 PDT 2015


On 6/1/15 6:24 PM, John Colvin wrote:
> Nonetheless, surely in this case the values should be the same
> regardless of the integer target type, no?

Hm... yeah probably :) I didn't grok the example thoroughly.

Makes me curious actually, and that does seem like a bug.

Doing some testing, if you assign a/b to a double and cast, it works. If 
you use a function to truncate taking real as a parameter, it returns 
999 in both ulong and long cases.

The assembly is too much over my head to figure out where the difference is.

I think you should file a codegen bug.

-Steve


More information about the Digitalmars-d mailing list