help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] gsl_isinf


From: ddneilson
Subject: Re: [Help-gsl] gsl_isinf
Date: Wed, 08 Oct 2008 16:56:48 -0600
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Jerome BENOIT wrote:
Hello,

Brian Gough wrote:
At Wed, 08 Oct 2008 17:51:39 +0800,
Jerome BENOIT wrote:
I have just noticed a weird behaviour for gsl_isinf (GSL 1.11):

gsl_isinf(GSL_NEGINF) give -1 (as expected) on some of my computers,
whereas it gives +1 on others: my computer are amd64 Debian boxes (Etch based and Lenny): Amazingly, it seems that this feature is not well tested.

Can you compare the result with the system isinf() function. Thanks.

It appeared that gsl_isinf() and isinf() give the same results.

Let me know if more information can be helpful.

Something to consider. Are the compilers identical on all platforms, and does the behaviour of isinf() change if you compile with no optimizations vs with full -O3? The C99 standard just has isinf() returning non-zero when the argument is infinity; the man page for isinf() even makes a point of pointing this out. Whereas glibc is supposed to return 1 for +inf, -1 for -inf, and 0 otherwise (according to the same man page). Considering that the C99 standard only calls for a non-zero return when the argument is infinity, it wouldn't surprise me if the compiler writers changed the behaviour of the function in a newer version of the compiler to eek out a few more clock cycles of speed.

-Daniel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]