[Issue 6531] assertion failure in std.range.iota

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 30 11:24:45 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=6531



--- Comment #11 from Martin Nowak <code at dawg.eu> 2013-10-30 11:24:42 PDT ---
> Indeed, casting does not seem sufficient to force correct rounding of
> intermediate results.
> Seems like the solution is to either assign and force rounding, or use
> approxEqual with appropriate constants for the error terms.

Yes, casting is optimized away by dmd.
Walter suggested to use an opaque function or inline asm to enforce rounding to
lower precision.
It seems like C99 addresses this by specifying that casts and assignments need
to be rounded to lower precision.

http://stackoverflow.com/questions/503436/how-to-deal-with-excess-precision-in-floating-point-computations/503523#503523

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list