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

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to