#include <cmath>
#include
double ceil (double x)
Liefert die kleinste Ganzzahl $n\geq x$.
x
Rückgabewert: ganzzahlige Oberschranke.
floor(), nearbyint(), rint(), round(), trunc().
#include <cmath> #include <iostream> int main() { double x = 12.345; std::cout << "ganzzahlige Begrenzungen: " << std::floor(x) << " <= " << x << " <= " << std::ceil(x) << '\n'; }