C examples for math.h:log10
function
<cmath> <ctgmath> <math.h>
Returns the common (base-10) logarithm of x.
long double log10l (long double x); long double log10 (long double x); double log10 (double x); float log10f (float x); float log10 (float x); double log10 (T x);
Parameter | Description |
---|---|
x | Value whose logarithm is calculated. If the argument is negative, a domain error occurs. |
Common logarithm of x.
If x is negative, it causes a domain error.
If x is zero, it may cause a pole error (depending on the library implementation).
#include <stdio.h> #include <math.h> int main ()//from w w w. j a v a2s . c o m { double param = 1234.0; double result = log10 (param); printf ("log10(%f) = %f\n", param, result ); return 0; }