Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

ceil, ceilf, ceill - Gleitpunktzahl aufrunden

&pagelevel(4)&pagelevel

Definition

#<math.h>

double ceil(double x);
float ceilf(float x);
long double ceilf(long double x);

Diese Funktionen runden die Gleitkommazahl x nach oben (ganzzahlig) auf.

Returnwert

Kleinste ganze Zahl im Gleitkommaformat, die größer oder gleich x ist.

Beispiel

#include <math.h>
#include <stdio.h>
int main(void)
{  double x;
  printf("Bitte geben Sie die aufzurundende Gleitkommazahl ein:\n");
  if (scanf("%lf", &x) == 1)
      printf("Die Zahl %g wird aufgerundet zu %f\n", x, ceil(x));
  return 0;}

Siehe auch

abs, fabs, floor