[Top][All Lists]

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

Re: [Help-gsl] gsl_isinf

From: Jerome BENOIT
Subject: Re: [Help-gsl] gsl_isinf
Date: Thu, 09 Oct 2008 07:59:22 +0800
User-agent: Mozilla-Thunderbird (X11/20080724)


indeed the compilers are not identical:
on the Etch based computers, where isinf(GSL_NEGINF) gives -1,
the (default) compiler is (`gcc --version'):
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) ,
whereas on the Lenny Computers, where isinf(GSL_NEGINF) give +1:
gcc (Debian 4.3.2-1) 4.3.2 .


ddneilson wrote:
Jerome BENOIT wrote:

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.



reply via email to

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