Datasheet
Floating-point Support
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-27
5.4.9 Return the exponent of a number (ilogb)
int ilogb(double x);
This function returns the exponent of
x
, without any bias, so
ilogb(1.0)
would return 0,
and
ilogb(2.0)
would return 1, and so on.
When applied to 0,
ilogb
returns
-0x7FFFFFFF
. When applied to a NaN or an infinity,
ilogb
returns
+0x7FFFFFFF
.
ilogb
causes no exceptions or errors.
5.4.10 Determine if a number is a NaN (isnan)
int isnan(double x);
This function returns 1 if
x
is a NaN, and 0 otherwise. It causes no exceptions or errors.
5.4.11 Bessel functions of the first kind (j0, j1, jn)
double j0(double x);
double j1(double x);
double jn(int n, double x);
These functions compute Bessel functions of the first kind.
j0
and
j1
compute the
functions of order 0 and 1 respectively.
jn
computes the function of order
n
.
If the absolute value of
x
exceeds π times 2
52
, these functions return an
ERANGE
error,
denoting total loss of significance in the result.
5.4.12 The logarithm of the gamma function (lgamma, lgamma_r)
double lgamma(double x);
double lgamma_r(double x, int *sign);
These functions compute the logarithm of the absolute value of the gamma function of
x. The sign of the function is returned separately, so that the two can be used to compute
the actual gamma function of x.
lgamma
returns the sign of the gamma function of x in the global variable
signgam
.
lgamma_r
returns it in a user variable, whose address is passed in the
sign
parameter. The
value, in either case, is either +1 or –1.
Both functions return an
ERANGE
error if the answer is too big to fit in a
double
.
Both functions return an
EDOM
error if x is zero or a negative integer.