std::floor - cppreference.com
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>
| Elemento definito nell'header <cmath> |
||
|
|
||
|
|
||
|
|
||
|
|
(dal C++11) | |
Calcola intera più vicina non superiore a 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.
Parametri
| arg | - | valore in virgola mobile Original: floating point value The text has been machine-translated via Google Translate. |
Valore di ritorno
Più vicino intero non superiore a arg
Original:
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.
[[Image:
Valore di ritorno
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
Note
Il valore intero può essere sempre rappresentato dal tipo di dato a virgola mobile.
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.
Esempio
#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
Vedi anche
intero più vicino non inferiore al valore dato Original: nearest integer not less than the given value The text has been machine-translated via Google Translate. (funzione) [modifica] | |
(C++11) |
intera più vicina non superiore in grandezza rispetto al valore dato Original: nearest integer not greater in magnitude than the given value The text has been machine-translated via Google Translate. (funzione) [modifica] |
(C++11) |
numero intero più vicino, l'arrotondamento a da zero in caso a metà strada Original: nearest integer, rounding away from zero in halfway cases The text has been machine-translated via Google Translate. (funzione) [modifica] |