std::ceil
Aus cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<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 nchste 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.
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. |
Rckgabewert
Nchste ganze Zahl nicht weniger als
argOriginal:
Nearest integer not less than
argThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[[Image:
Rckgabewert
|200x200px]]Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Argument
Notes
Wenn das Argument unendlich (positiv oder negativ) oder Null (positiv oder negativ), ist der Rckgabewert 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.
You can help to correct and verify the translation. Click here for instructions.
Die grte darstellbare Fliekommawerte sind genaue Zahlen in allen gngigen Fliekommaformate, so dass diese Funktion nie berluft .
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.
You can help to correct and verify the translation. Click here for instructions.
Diese Funktion kann jedoch nicht erforderlich, erhhen FE_INEXACT Gleitkomma-Ausnahmen fr 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.
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
nchste ganze Zahl nicht grer 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) | |
(C++11) |
nchste Ganzzahl nicht betragsmig grer 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) |
(C++11) (C++11) (C++11) |
nchste ganze Zahl, Rundung von Null weg in halbwegs Fllen 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) |
(C++11) (C++11) (C++11) |
nchste 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) |
(C++11) |
nchste 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) |