This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::isfinite broken?


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.  Sorry if the statement was confusing.  The code looks something
like:

[calculate x]
if (not isfinite (x))
  throw std::runtime_error ("blah")


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]