## File: Infinities-and-Not_002da_002dnumber.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (133 lines) | stat: -rw-r--r-- 6,138 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 GNU Scientific Library – Reference Manual: Infinities and Not-a-number

4.2 Infinities and Not-a-number

Macro: GSL_POSINF

This macro contains the IEEE representation of positive infinity, +\infty. It is computed from the expression +1.0/0.0.

Macro: GSL_NEGINF

This macro contains the IEEE representation of negative infinity, -\infty. It is computed from the expression -1.0/0.0.

Macro: GSL_NAN

This macro contains the IEEE representation of the Not-a-Number symbol, NaN. It is computed from the ratio 0.0/0.0.

Function: int gsl_isnan (const double x)

This function returns 1 if x is not-a-number.

Function: int gsl_isinf (const double x)

This function returns +1 if x is positive infinity, -1 if x is negative infinity and 0 otherwise.6

Function: int gsl_finite (const double x)

This function returns 1 if x is a real number, and 0 if it is infinite or not-a-number.

Footnotes

(6)

Note that the C99 standard only requires the system isinf function to return a non-zero value, without the sign of the infinity. The implementation in some earlier versions of GSL used the system isinf function and may have this behavior on some platforms. Therefore, it is advisable to test the sign of x separately, if needed, rather than relying the sign of the return value from gsl_isinf().