std::floor
Aus cppreference.com
<metanoindex/>
<tbody> </tbody>| definiert in Header <cmath>
|
||
float floor( float arg ); |
||
double floor( double arg ); |
||
long double floor( long double arg ); |
||
double floor( Integral arg ); |
(seit C++11) | |
Berechnet nächste ganze Zahl nicht größer als
arg . Original:
Computes nearest integer not greater 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. |
Rückgabewert
Nächste ganze Zahl nicht größer als
argOriginal:
Nearest integer not greater 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:
Rückgabewert
|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
Die Integer-Wert kann immer durch die gegebene Fließkomma-Typ dargestellt werden .
Original:
The integer value can be always represented by the given floating point type.
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()
{
std::cout << std::fixed;
std::cout << std::floor(12.0) << '\n';
std::cout << std::floor(12.1) << '\n';
std::cout << std::floor(12.5) << '\n';
std::cout << std::floor(12.9) << '\n';
std::cout << std::floor(13.0) << '\n';
}
Output:
12.000000
12.000000
12.000000
12.000000
13.000000
