December 18, 2019
On Tuesday, 17 December 2019 at 12:40:10 UTC, Timon Gehr wrote:
> On 16.12.19 13:25, Johannes Loher wrote:
>> I admit that Timon’s explanations sounded a bit harsh
>
> I reported an obvious issue. It's really a no-brainer, but some people somehow feel the need to intervene and argue in favour of the trivially wrong behavior (this is an issue of basic arithmetic), calling my precious code nonsensical or trying to argue that I must not be aware that built-in integer types have finite precision, etc.

+1

It's integer arithmetic, so it should just return 0 if the mathematically correct result would be less than 1.

A short example:
---
int a = 5;
int b = 25;
int c = a / b;
---
Should this throw an exception or cause a divide by zero error?
If not, why should the "^^" operator behave different?

December 18, 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.


1 2 3 4 5 6 7 8
Next ›   Last »