Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

log10, log10f, log10l - Logarithmus zur Basis 10

&pagelevel(4)&pagelevel

Definition

#include <math.h>

double log10(double x);
float log10f(float x); (C11)
long double log10l(long double x); (C11)

Diese Funktionen berechnen den Logarithmus der positiven Gleitkommazahl x zur Basis 10.

Returnwert 

lg(x)

für positive x.

 

-HUGE_VAL
-HUGE_VALF
-HUGE_VALL

abhängig vom Funktionstyp,
falls x kleiner 0 ist; zusätzlich wird errno auf EDOM gesetzt (domain error)
oder
falls x gleich 0 ist; zusätzlich wird errno auf ERANGE gesetzt.

Beispiel

#include <math.h>
#include <stdio.h>
int main(void)
{
  double x;
  printf("Beispiel fuer log10(x): Bitte x eingeben\n");
  if(scanf("%lf", &x) == 1)
  printf("x = %g log10(x) = %g\n", x, log10(x));
  return 0;
}

Siehe auch

log, log2, exp, exp2