NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | ERRORS (due to Round-off) | RETURN VALUES | NOTES | ATTRIBUTES | SEE ALSO
$(NUCLEUS_DIR)/lib/libm.a #include <math.h>double exp(double x);
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.
The exp() function computes the exponential value of the given argument x .
The expm1() function computes the value exp(x)-1 accurately even for extremely small values of x .
The log() function computes the natural logarithm of the argument x.
The log10() function computes the logarithm of argument x to base 10.
The log1p() function computes the value of log(1+x) accurately even for extremely small values of x .
The pow() computes the value of x to the exponent y .
The exp x() , log x() , expm1 x() and log1p x() functions are accurate to within a ulp . log10 x() is accurate to within approximately 2 ulp s. A ulp is one U nit in the L ast P lace. The error in pow x y() is below about 2 ulp s when its magnitude is moderate, but increases as pow x y() approaches the over/underflow thresholds. Almost as many bits as are occupied by the floating-point format's exponent field could be lost, that is, 11 bits for IEEE 754 Double. The worst errors observed during testing have been under 300 ulp s for IEEE 754 Double. Moderate values of pow() are sufficiently accurate that pow x y() is precise until it is greater than 2**53 for IEEE 754.
These functions will return the appropriate computation unless an error occurs or an argument is out of range. The functions exp() , expm1() , and pow() detect if the computed value will overflow, set errno to ERANGE , and a system-dependent notification is performed. The pow x y() function checks whether x < 0 and y is not an integer. If this is true, errno is set to EDOM and a system-dependent notification is performed. log() and log1p() return the appropriate computation for x > 0 and x > -1, respectively. For any other argument, errno is set to EDOM and a system-dependent notification is performed.
The function pow x 0() returns x**0 = 1 for all x including x = 0, [infin ], and NaN .
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | ERRORS (due to Round-off) | RETURN VALUES | NOTES | ATTRIBUTES | SEE ALSO