◐ Shell
clean mode source ↗

std::ceil – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

definiert in Header

<cmath>

float ceil( float arg );

double ceil( double arg );

long double ceil( long double arg );

double ceil( Integral arg );

(seit C++11)

Berechnet nächste ganze Zahl nicht weniger als arg .

Original:

Computes nearest integer not less than arg.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parameter

arg -

Floating-Point-Wert

Original:

floating point value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Rückgabewert

Nächste ganze Zahl nicht weniger als arg

Original:

Nearest integer not less than arg

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[[Image:

Rückgabewert

Original:

{{{2}}}

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

|200x200px]]

Argument

Notes

Wenn das Argument unendlich (positiv oder negativ) oder Null (positiv oder negativ), ist der Rückgabewert das gleiche wie das Argument .

Original:

If the argument is infinity (positive or negative) or zero (positive or negative), the return value is the same as the argument.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Die größte darstellbare Fließkommawerte sind genaue Zahlen in allen gängigen Fließkommaformate, so dass diese Funktion nie überläuft .

Original:

The largest representable floating-point values are exact integers in all standard floating-point formats, so this function never overflows.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Diese Funktion kann jedoch nicht erforderlich, erhöhen FE_INEXACT Gleitkomma-Ausnahmen für nicht-ganzzahligen Argumenten .

Original:

This function may, but is not required to, raise FE_INEXACT floating-point exceptions for non-integer arguments.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Beispiel

#include <cmath>
#include <iostream>
 
int main()
{
    double a = 12.0;
    std::cout << std::fixed;
    std::cout << std::ceil(12.0) << '\n';
    std::cout << std::ceil(12.1) << '\n';
    std::cout << std::ceil(12.5) << '\n';
    std::cout << std::ceil(12.9) << '\n';
    std::cout << std::ceil(13.0) << '\n';}

Output:

12.000000
13.000000
13.000000
13.000000
13.000000

Siehe auch

nächste ganze Zahl nicht größer als der gegebene Wert

Original:

nearest integer not greater than the given value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(Funktion) [edit]

(C++11)

nächste Ganzzahl nicht betragsmäßig größer als der gegebene Wert

Original:

nearest integer not greater in magnitude than the given value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(Funktion) [edit]

(C++11)
(C++11)
(C++11)

nächste ganze Zahl, Rundung von Null weg in halbwegs Fällen

Original:

nearest integer, rounding away from zero in halfway cases

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(Funktion) [edit]

(C++11)
(C++11)
(C++11)

nächste ganze Zahl mit aktuellen Rundung Modus mit
Ausnahme, wenn das Ergebnis unterscheidet

Original:

nearest integer using current rounding mode with
exception if the result differs

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(Funktion) [edit]

(C++11)

nächste ganze Zahl mit aktuellen Rundung Modus

Original:

nearest integer using current rounding mode

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(Funktion) [edit]