Re: std::isfinite broken?

2008-07-31 Thread Neal Becker
Paolo Carlini wrote: Hi ho, ho!! ;) It worked with me. Try a recent gcc (eg, 4.3.x) and you will get the same, actually expected, result of the original poster. Paolo. I believe this is a bug. I agree that -ffast-math will not always comply 100% with IEEE, as advertised. But, if I

RE: std::isfinite broken?

2008-07-31 Thread Dave Korn
Neal Becker wrote on 31 July 2008 12:42: Paolo Carlini wrote: Hi ho, ho!! ;) It worked with me. Try a recent gcc (eg, 4.3.x) and you will get the same, actually expected, result of the original poster. Paolo. I believe this is a bug. I agree that -ffast-math will not always comply

RE: std::isfinite broken?

2008-07-31 Thread Dave Korn
Dave Korn wrote on 31 July 2008 12:45: Neal Becker wrote on 31 July 2008 12:42: If it is really intended not to work, then at least documentation should state that. It does, as was already explained to you; re-read the thread. Actually I can be more use than that, I'll show you the

Re: std::isfinite broken?

2008-07-30 Thread Eus
Hi Ho! --- On Tue, 7/29/08, Neal Becker [EMAIL PROTECTED] wrote: Paolo Carlini wrote: ... ah, ok, now I see what you meant, you meant that x is *not* finite, still, std::isfinite(x) != 0. Still, testcase badly needed... Paolo. #include cmath #include stdexcept int main () {

Re: std::isfinite broken?

2008-07-30 Thread Paolo Carlini
Hi ho, ho!! ;) It worked with me. Try a recent gcc (eg, 4.3.x) and you will get the same, actually expected, result of the original poster. Paolo.

std::isfinite broken?

2008-07-28 Thread Neal Becker
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?

Re: std::isfinite broken?

2008-07-28 Thread Paolo Carlini
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

Re: std::isfinite broken?

2008-07-28 Thread Neal Becker
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

Re: std::isfinite broken?

2008-07-28 Thread Richard Guenther
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

Re: std::isfinite broken?

2008-07-28 Thread Paolo Carlini
... ah, ok, now I see what you meant, you meant that x is *not* finite, still, std::isfinite(x) != 0. Still, testcase badly needed... Paolo.

Re: std::isfinite broken?

2008-07-28 Thread Paolo Carlini
Neal Becker wrote: 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) Well, -ffast-math implies -ffinite-math-only, I think

Re: std::isfinite broken?

2008-07-28 Thread Neal Becker
Paolo Carlini wrote: ... ah, ok, now I see what you meant, you meant that x is *not* finite, still, std::isfinite(x) != 0. Still, testcase badly needed... Paolo. #include cmath #include stdexcept int main () { double x = log (0); if (not std::isfinite (x)) { throw std::runtime_error