[Issue 9937] CTFE floats don't overflow correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 22 08:23:37 PDT 2013


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



--- Comment #6 from Don <clugdbug at yahoo.com.au> 2013-04-22 08:23:35 PDT ---
(In reply to comment #5)
> Yes, having a runtime computation be different from a compile time computation
> is a potential result of doing floating point math at higher precision at
> compile time.
> 
> However, this is as designed and is expected.
> 
> It is a programming error in D to rely on limited precision. The only time I've
> seen legitimate code that relied on limited precision is as part of a test
> suite - i.e. not a real application.

Are you sure your recognized it? I've written very little floating point code
that didn't! Cephes relies on it, for example.

It's not difficult to cope with x87 using C's semantics, but this is not at all
the same as saying that you can add extra bits of precision *anywhere* without
impact.

It is impossible to generate correct results in the lowest bit, without knowing
the target precision. Otherwise you get double rounding.
I think this can be proved mathematically.

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