LOG(3) NetBSD Library Functions Manual LOG(3)NAME

log,logf,logl,log10,log10f,log10l,log1p,log1pf,log1pl,log2,log2f log2l-- logarithm functionsLIBRARY

Math Library (libm, -lm)SYNOPSIS

#include <math.h>doublelog(double x);floatlogf(float x);long doublelogl(long double x);doublelog10(double x);floatlog10f(float x);log doublelog10l(long double x);doublelog1p(double x);floatlog1pf(float x);long doublelog1pl(long double x);doublelog2(double x);floatlog2f(float x);long doublelog2l(long double x);DESCRIPTION

The following functions compute logarithms:·Thelog(),logf() andlogl() functions return the natural loga- rithm.·Thelog10(),log10f() andlog10l() functions return the base 10 logarithm.·Thelog1p(),log1pf() andlog1pl() functions return the natural logarithm of (1.0 +x) accurately even for very small values ofx.·Thelog2(),log2f() andlog2l() functions return the base 2 loga- rithm.RETURN VALUES

Upon successful completion, the functions return the logarithm ofxas described above. Otherwise the following may occur: 1. IfxisNaN, all functions returnNaN. 2. Ifxis positive infinity, all functions returnx. Ifxis negative infinity, all functions returnNaN. 3. Ifxis +0.0 or -0.0, thelog(),log10(), andlog2() families return either -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, whereas thelog1p() family returnsx. 4. Ifxis +1.0, thelog(),log10(), andlog2() families return +0.0. Ifxis -1.0, thelog1p() family returns -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL. In addition, on a VAX,errnois set to EDOM and the reserved operand is returned bylog() unlessx> 0, bylog1p() unlessx> -1.SEE ALSO

exp(3), ilogb(3), math(3)STANDARDS

The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').HISTORY

Alog() function appeared in Version 1 AT&T UNIX. NetBSD 10.99 January 24, 2024 NetBSD 10.99

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.