Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 902 Bytes

094_log10.asciidoc

File metadata and controls

54 lines (34 loc) · 902 Bytes

log10

NAME

log10 - The log10() function returns the "base 10" logarithm of x.

SYNOPSIS
#include <math.h>

double log10(double x);
DESCRIPTION

The log10() function returns the natural logarithm of x.

Warning
You’ll also need to link the program against the math library (see example below) using the -lm compile/link option.
RETURN VALUE

Returns the logarithm "base 10" of parameter x.

ERRORS
  • EDOM - The argument x is negative.

  • ERANGE - The argument x is zero. The log of zero is not defined.

SEE ALSO

log, exp, pow, sqrt

EXAMPLE
link:src/log10.c[role=include]
OUTPUT
$ gcc -Wall -lm log10.c
$ ./a.out
log10(1000.000000) = 3.000000