issue 7006 - std.math.pow (integral, integral) crashes on negative exponents

Timon Gehr timon.gehr at gmx.ch
Wed Dec 18 04:58:46 UTC 2019


On 18.12.19 05:23, Timon Gehr wrote:
> 
> As pow(NaN,0.0) is not "specified above", this seems to say that 
> pow(0.0/0.0,0.0) should be NaN. However, g++ gives me 1.

https://en.cppreference.com/w/cpp/numeric/math/pow

"pow(base, ±0) returns 1 for any base, even when base is NaN"

Rofl. Ola somehow managed to gaslight me into thinking that wasn't there 
after I had already used it to draw conclusions. Therefore, the page 
_really_ states that the result must be either 1 or NaN (in case the 
implementation supports NaN, otherwise it can be anything), as I 
originally claimed, and the only thing I was wrong about tonight was I 
being wrong. Sorry for the noise.

Also, that does it. Ola, you are back in my kill file.


More information about the Digitalmars-d mailing list