Re: std::isinf(-inf) strange results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2017 at 05:08:07PM +0100, Andrew - wrote:
> Is this the expected behaviour when std::isinf(-inf) yields 0 or -1
> instead of 1?

It returns a bool, not a number.

> Granted, -Ofast is allowed to disregard some standards in favor of
> performance... but is it allowed to produce code that is plain wrong?

-Ofast includes -ffast-math which includes -ffinite-math-only.  Nothing
is wrong here, everything works as designed, the only thing plain wrong
is using infinities when you promised not to :-)

> Furthermore, std::isinf sometimes takes the output of isinf from the
> math library without casting it to bool, which, as far as I know,
> doesn`t comply to the standard.

Yeah this looks weird.

> The question is whether I should report any of this as a GCC bug.

I think you should yes.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux