1LOG10(3P)                  POSIX Programmer's Manual                 LOG10(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       log10, log10f, log10l — base 10 logarithm function
14

SYNOPSIS

16       #include <math.h>
17
18       double log10(double x);
19       float log10f(float x);
20       long double log10l(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 the base 10 logarithm of their argument
29       x, log10(x).
30
31       An application wishing to check for error situations should  set  errno
32       to  zero  and  call  feclearexcept(FE_ALL_EXCEPT)  before calling these
33       functions. On return, if errno is non-zero or fetestexcept(FE_INVALID |
34       FE_DIVBYZERO  |  FE_OVERFLOW  | FE_UNDERFLOW) is non-zero, an error has
35       occurred.
36

RETURN VALUE

38       Upon successful completion, these functions shall return  the  base  10
39       logarithm of x.
40
41       If  x  is  ±0,  a  pole  error  shall  occur and log10(), log10f(), and
42       log10l() shall return −HUGE_VAL, −HUGE_VALF,  and  −HUGE_VALL,  respec‐
43       tively.
44
45       For  finite values of x that are less than 0, or if x is −Inf, a domain
46       error shall occur, and either a NaN (if supported), or  an  implementa‐
47       tion-defined value shall be returned.
48
49       If x is NaN, a NaN shall be returned.
50
51       If x is 1, +0 shall be returned.
52
53       If x is +Inf, +Inf shall be returned.
54

ERRORS

56       These functions shall fail if:
57
58       Domain Error
59                   The finite value of x is negative, or x is −Inf.
60
61                   If  the  integer expression (math_errhandling & MATH_ERRNO)
62                   is non-zero, then errno shall be set  to  [EDOM].   If  the
63                   integer  expression  (math_errhandling & MATH_ERREXCEPT) is
64                   non-zero, then the invalid floating-point  exception  shall
65                   be raised.
66
67       Pole Error  The value of x is zero.
68
69                   If  the  integer expression (math_errhandling & MATH_ERRNO)
70                   is non-zero, then errno shall be set to [ERANGE].   If  the
71                   integer  expression  (math_errhandling & MATH_ERREXCEPT) is
72                   non-zero, then the divide-by-zero floating-point  exception
73                   shall be raised.
74
75       The following sections are informative.
76

EXAMPLES

78       None.
79

APPLICATION USAGE

81       On   error,   the   expressions  (math_errhandling  &  MATH_ERRNO)  and
82       (math_errhandling & MATH_ERREXCEPT) are independent of each other,  but
83       at least one of them must be non-zero.
84

RATIONALE

86       None.
87

FUTURE DIRECTIONS

89       None.
90

SEE ALSO

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