std::div, std::ldiv, std::lldiv
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. |
Elemento definito nell'header <cstdlib>
|
||
std::div_t div( int x, int y ); |
||
std::ldiv_t div( long x, long y ); |
||
std::lldiv_t div( long long x, long long y ); |
(dal C++11) | |
std::ldiv_t ldiv( long x, long y ); |
||
std::lldiv_t lldiv( long long x, long long y ); |
(dal C++11) | |
Elemento definito nell'header <cinttypes>
|
||
std::imaxdiv_t div( std::intmax_t x, std::intmax_t y ); |
(dal C++11) | |
std::imaxdiv_t imaxdiv( std::intmax_t x, std::intmax_t y ); |
(dal C++11) | |
Calcola il quoziente (il risultato del x/y espressione) e restante (il risultato del x%y espressione) simultaneamente. (dal C++11)
Original:
Computes the quotient (the result of the expression x/y) and remainder (the result of the expression x%y) simultaneously. (dal C++11)
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.
Calcola quoziente e resto contemporaneamente. Il quoziente è il quoziente algebrica con qualsiasi parte frazionaria scartata (troncato a zero). Il resto è tale che quot * y + rem == x. (fino al c++11)
Original:
Computes quotient and remainder simultaneously. The quotient is the algebraic quotient with any fractional part discarded (truncated towards zero). The remainder is such that quot * y + rem == x. (fino al c++11)
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.
Indice |
[modifica] Note
Fino al C + +11, la direzione arrotondamento del quoziente e il segno del resto nel built-in operatori di divisione e resto è stato definito dall'implementazione se uno degli operandi è stato negativo, ma è stato ben definito in std::div.
Original:
Until C++11, the rounding direction of the quotient and the sign of the remainder in the built-in division and remainder operators was implementation-defined if either of the operands was negative, but it was well-defined in std::div.
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.
[modifica] Parametri
x, y | - | valori interi
Original: integer values The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica] Valore di ritorno
Struttura di tipo
div_t
, ldiv_t
, ldiv_t
, imaxdiv_t
definita come:Original:
Structure of type
div_t
, ldiv_t
, ldiv_t
, imaxdiv_t
defined as: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.
struct div_t { int quot; // The quotient int rem; // The remainder }; struct ldiv_t { long quot; // The quotient long rem; // The remainder }; struct lldiv_t { long long quot; // The quotient long long rem; // The remainder }; struct imaxdiv_t { std::intmax_t quot; // The quotient std::intmax_t rem; // The remainder };
[modifica] Vedi anche
resto dell'operazione divisione floating point Original: remainder of the floating point division operation The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |