1LOG1P(3P)                  POSIX Programmer's Manual                 LOG1P(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       log1p, log1pf, log1pl — compute a natural logarithm
14

SYNOPSIS

16       #include <math.h>
17
18       double log1p(double x);
19       float log1pf(float x);
20       long double log1pl(long double x);
21

DESCRIPTION

23       The functionality described on this reference page is aligned with  the
24       ISO C  standard.  Any  conflict between the requirements described here
25       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2008
26       defers to the ISO C standard.
27
28       These functions shall compute loge(1.0 + x).
29
30       An  application  wishing to check for error situations should set errno
31       to zero and  call  feclearexcept(FE_ALL_EXCEPT)  before  calling  these
32       functions. On return, if errno is non-zero or fetestexcept(FE_INVALID |
33       FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero,  an  error  has
34       occurred.
35

RETURN VALUE

37       Upon  successful  completion,  these functions shall return the natural
38       logarithm of 1.0 + x.
39
40       If x is −1, a  pole  error  shall  occur  and  log1p(),  log1pf(),  and
41       log1pl()  shall  return  −HUGE_VAL, −HUGE_VALF, and −HUGE_VALL, respec‐
42       tively.
43
44       For finite values of x that are less than −1, or if x is −Inf, a domain
45       error  shall  occur, and either a NaN (if supported), or an implementa‐
46       tion-defined value shall be returned.
47
48       If x is NaN, a NaN shall be returned.
49
50       If x is ±0, or +Inf, x shall be returned.
51
52       If x is subnormal, a range error may occur
53       and x should be returned.
54
55       If x is not returned, log1p(), log1pf(), and log1pl() shall  return  an
56       implementation-defined  value  no  greater  in  magnitude than DBL_MIN,
57       FLT_MIN, and LDBL_MIN, respectively.
58

ERRORS

60       These functions shall fail if:
61
62       Domain Error
63                   The finite value of x is less than −1, or x is −Inf.
64
65                   If the integer expression (math_errhandling  &  MATH_ERRNO)
66                   is  non-zero,  then  errno  shall be set to [EDOM].  If the
67                   integer expression (math_errhandling &  MATH_ERREXCEPT)  is
68                   non-zero,  then  the invalid floating-point exception shall
69                   be raised.
70
71       Pole Error  The value of x is −1.
72
73                   If the integer expression (math_errhandling  &  MATH_ERRNO)
74                   is  non-zero,  then errno shall be set to [ERANGE].  If the
75                   integer expression (math_errhandling &  MATH_ERREXCEPT)  is
76                   non-zero,  then the divide-by-zero floating-point exception
77                   shall be raised.
78
79       These functions may fail if:
80
81       Range Error The value of x is subnormal.
82
83                   If the integer expression (math_errhandling  &  MATH_ERRNO)
84                   is  non-zero,  then errno shall be set to [ERANGE].  If the
85                   integer expression (math_errhandling &  MATH_ERREXCEPT)  is
86                   non-zero, then the underflow floating-point exception shall
87                   be raised.
88
89       The following sections are informative.
90

EXAMPLES

92       None.
93

APPLICATION USAGE

95       On  error,  the  expressions  (math_errhandling   &   MATH_ERRNO)   and
96       (math_errhandling  & MATH_ERREXCEPT) are independent of each other, but
97       at least one of them must be non-zero.
98

RATIONALE

100       None.
101

FUTURE DIRECTIONS

103       None.
104

SEE ALSO

106       feclearexcept(), fetestexcept(), log()
107
108       The Base Definitions volume of POSIX.1‐2008, Section 4.19, Treatment of
109       Error Conditions for Mathematical Functions, <math.h>
110
112       Portions  of  this text are reprinted and reproduced in electronic form
113       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
114       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
115       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
116       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
117       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
118       event of any discrepancy between this version and the original IEEE and
119       The Open Group Standard, the original IEEE and The Open Group  Standard
120       is  the  referee document. The original Standard can be obtained online
121       at http://www.unix.org/online.html .
122
123       Any typographical or formatting errors that appear  in  this  page  are
124       most likely to have been introduced during the conversion of the source
125       files to man page format. To report such errors,  see  https://www.ker
126       nel.org/doc/man-pages/reporting_bugs.html .
127
128
129
130IEEE/The Open Group                  2013                            LOG1P(3P)
Impressum