[Issue 5566] New: [64-bit] More erratic FP results with size_t
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 12 08:40:13 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5566
Summary: [64-bit] More erratic FP results with size_t
Product: D
Version: D2
Platform: x86_64
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: dsimcha at yahoo.com
--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-02-12 08:37:43 PST ---
I think this bug might have the same root cause as bug 5565. It was reduced
from completely different code and I don't really understand the root cause of
either very well, though, so I'm filing a separate bug report in case I'm
wrong. Even if it is related to 5565, this test case is simpler.
import std.math, std.stdio;
double fun(ulong k, ulong n, double p) {
return pow(1.0 - p, cast(double) n);
}
void main() {
// Should print 0.8 ^ 10 = 0.1073741824. Prints 0.956352.
writeln(fun(0, 10, 0.2));
}
--
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