NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
$(NUCLEUS_DIR)/lib/libm.a #include <math.h>double copysign(double x, double y);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
These functions are required for the IEEE 754 standard for floating-point arithmetic.
The copysign() function returns x with its sign changed to that of y .
The drem() function returns the remainder r as follows:
r : = x - n*y
Where, n is the integer closest to the exact value of x/y . If | n - x/y | = 1/2, then n is even. Consequently, the remainder is computed exactly and | r | <= | y | / 2.
drem x 0() is exceptional.
The finite() function returns true (1) if the argument x is neither infinity nor NaN ( N ot a N umber) value. Otherwise, it returns false (0).
The logb() function computes the exponent of x , which is the integral part of log2 | x | , as a signed floating point value for nonzero x .
The scalb() function returns x * (2** n ) computed, for integer n , without first computing 2** n .
The IEEE 754 standard defines drem x 0() and drem infinity y() as invalid operations that produce a NaN .
IEEE 754 defines logb +- infinity() = + infinity , and logb 0() = -HUGE_VAL , and requires the latter to signal Division-by-Zero. On successful completion, logb() returns the exponent of x .
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO