Thread overview
[Issue 13469] x^^y wrong result
Sep 18, 2014
Don
Dec 12, 2017
Iain Buclaw
September 18, 2014
https://issues.dlang.org/show_bug.cgi?id=13469

Илья Ярошенко <ilyayaroshenko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--
September 18, 2014
https://issues.dlang.org/show_bug.cgi?id=13469

--- Comment #1 from Don <clugdbug@yahoo.com.au> ---
Are you sure this isn't just the difference in precision between double and real? The compile time values are done at 80 bit precision. The runtime pow() is done with 64 bit floats.

--
September 18, 2014
https://issues.dlang.org/show_bug.cgi?id=13469

--- Comment #2 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
You are right!

Any way CTFE^^ and Runtime^^ should be identical between each other and std.math pow.


import std.math;
static assert(1.7^^1000 == double(1.7).pow(1000));//OK
void main() {
       assert(1.7^^1000 ==   real(1.7).pow(1000));//OK (but should fails!)
}

--
December 12, 2017
https://issues.dlang.org/show_bug.cgi?id=13469

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ibuclaw@gdcproject.org
         Resolution|---                         |INVALID

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
CTFE folds floating point expressions at the highest precision supported by target.  This is not going to change.

--