div, ldiv, 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. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <stdlib.h>
|
||
div_t div( int x, int y ); |
||
ldiv_t ldiv( long x, long y ); |
||
lldiv_t lldiv( long long x, long long y ); |
||
| Elemento definito nell'header <inttypes.h>
|
||
imaxdiv_t imaxdiv( intmax_t x, intmax_t y ); |
||
Calcola il quoziente (il risultato del
x/y espressione) e restante (il risultato del x%y espressione) simultaneamente. (dal C99)Original:
Computes the quotient (the result of the expression
x/y) and remainder (the result of the expression x%y) simultaneously. (dal C99)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 C99)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 C99)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.
Note
Fino al C99, la direzione arrotondamento del quoziente e il segno del resto nelle built-in operatori di divisione e il resto è stato definito dall'implementazione se uno degli operandi è stato negativo, ma è stato ben definito in
div e ldiv.Original:
Until C99, 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
div and ldiv.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.
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. |
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
};
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) | |
C++ documentation for div
|