Thread overview | |||||
---|---|---|---|---|---|
|
February 19, 2012 [Issue 7548] New: Less specific lowering of power operator was chosen, causing 10.0L^^2 == 99.999999999999999993L | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7548 Summary: Less specific lowering of power operator was chosen, causing 10.0L^^2 == 99.999999999999999993L Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: kennytm@gmail.com --- Comment #0 from kennytm@gmail.com 2012-02-19 13:59:17 PST --- Test case: ----------------------------------- import std.math; void main() { int e = 2; real r = 10.0L; assert(pow(r, e) == 100.0L); // passes assert(r^^e == 100.0L); // fails on 64-bit. } ----------------------------------- The problem was 'r^^e' is using the version of 'std.math.pow' with a real exponent, although the version with integral exponent should be chosen, which allows a better precision. The front end should avoid casting 'e2' in a PowExp to 'real' too early. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 03, 2013 [Issue 7548] Less specific lowering of power operator was chosen, causing 10.0L^^2 == 99.999999999999999993L | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=7548 safety0ff.bugz@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |safety0ff.bugz@gmail.com --- Comment #1 from safety0ff.bugz@gmail.com 2013-10-02 22:17:52 PDT --- Patch in issue 11159 fixes this, r^^e was using CTFE. One issue should be marked duplicate of the other. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 04, 2013 [Issue 7548] Less specific lowering of power operator was chosen, causing 10.0L^^2 == 99.999999999999999993L | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=7548 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |DUPLICATE --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2013-10-03 22:57:15 PDT --- *** This issue has been marked as a duplicate of issue 11159 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation