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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Dec 18 08:31:06 UTC 2019


On Wednesday, 18 December 2019 at 04:58:46 UTC, Timon Gehr wrote:
> 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.

Nah, you are gaslighting yourself. You are also being generally 
hostile in this thread and keep going ad hominem repeatedly for 
no good reason. That is not healthy.

cppreference.com is a user manual, written by C++ users. g++ is 
irrelevant.

You asked me (for God knows what reason) what the C++17 ISO 
STANDARD says.  Why can't you look it up yourself? Oh... I get 
it. You are perfection, a priori… There is only one correct view, 
and that is yours. I get it.

ISO standards are generally only available for free as drafts. I 
gave you what a standard draft from 2017 says. I assume (perhaps 
wrongly) that the final standard is close to this.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4713.pdf

PAGE 949, full quote:

«
template<class T> complex<T> pow(const complex<T>& x, const 
complex<T>& y);
template<class T> complex<T> pow(const complex<T>& x, const T& y);
template<class T> complex<T> pow(const T& x, const complex<T>& y);

Returns: The complex power of base x raised to the y th power, 
defined as exp(y * log(x)). The
value returned for pow(0, 0) is implementation-defined.

Remarks: The branch cuts are along the negative real axis.
»


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

And that is something no sane person would not make a point of 
announcing. If you choose to be ignorant, keep it to yourself.

Welcome to the kindergarten... actually most kids behave better, 
to be honest.




More information about the Digitalmars-d mailing list