[Issue 7455] Allow a cast to discard precision from a floating point during constant folding

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 13 10:30:19 PST 2012


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



--- Comment #6 from dawg at dawgfoto.de 2012-02-13 10:30:16 PST ---
>Moreover, why allow cast(float) if it isn't supposed to work?

To summarize it.
The floating point rules are relaxed such that omitting cast(real)cast(float)
is a valid transformation. I think that's generally a better idea than to waste
all those cycles. There is currently no mechanism to distinguish explicit casts
from implicit casts in the backend.
Walter's solution solves the problem so this should be fine.
Any opinion on whether this would be a candidate for std.math?

-- 
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