Boost logo

Boost :

Subject: Re: [boost] [math] boost::math::isfinite fails with --fast-math
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2012-11-26 12:01:58


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Tim
> Blechmann
> Sent: Monday, November 26, 2012 4:31 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [math] boost::math::isfinite fails with --fast-math
>
> >> Which fails - does the 0/0 actually yield an infinity? Or is it isfinite
> >> > that fails?
> > 0/0 should yield NaN, not infinity.
>
> 0/0 can yield anything, if -ffast-math is passed as compile flag ...

You are both right - sorry I got my infinite and infinity mis-typed.

-ffinite-math-only, <<<<<<<<<<<< so the IEEE pattern for infinity will never be set.

-fno-signaling-nans <<<<<<<<<<<< so the IEEE pattern for signalling will never be set.

(-ffast-math sets a whole group of options, including these).

But it appears from Gaetano's tests that the (or a) pattern for *quiet_NaN is set*.

So I would expect that isnan might work.

But I agree with John that this is a dodgy ill-defined area.

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk