On Mon, Jul 28, 2008 at 1:52 PM, Neal Becker <[EMAIL PROTECTED]> wrote: > Paolo Carlini wrote: > >> Neal Becker wrote: >>> gcc-4.3.0-8.x86_64 >>> >>> I have test code that does passes std::isfinite (x), yet if I print the >>> values to std::cout the value printed is 'inf'. Is std::isfinite (x) >>> broken? >>> >> Whatever bug it may have - it can, of course - std::isfinite returns an >> *int*, therefore your statement seems at the very least rather weird. A >> self-contained testcase is badly needed. >> >> Paolo. > > I found that compiling without -ffast-math would allow std::isfinite to > work.
That's by desing. With -ffast-math you are assessing that Infs and NaNs do not occur, so the compiler optimizes the call to isfinite. Richard.