std::fdim
De cppreference.com
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <cmath>
|
||
float fdim( float x, float y ); |
(1) | (desde C++11) |
double fdim( double x, double y ); |
(2) | (desde C++11) |
long double fdim( long double x, long double y ); |
(3) | (desde C++11) |
Promoted fdim( Arithmetic x, Arithmetic y ); |
(4) | (desde C++11) |
Retorna a diferença positiva entre
x e y.Original:
Returns the positive difference between
x and y.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.
Isto pode ser implementado como
fmax (x - y, 0), por isso, se x ≤ y, o resultado é sempre igual a 0, caso contrário é x - y.Original:
This could be implemented as
fmax (x - y, 0), so if x ≤ y, the result is always equals to 0, otherwise it is x - y.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.
4)
Se algum argumento tem tipo integral, ele é convertido para
double. Se qualquer outro argumento é long double, em seguida, o tipo de retorno é long double, caso contrário é double.Original:
If any argument has integral type, it is cast to
double. If any other argument is long double, then the return type is long double, otherwise it is double.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.
Parâmetros
| x, y | - | flutuando valor de ponto
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. |
Valor de retorno
O valor da diferença positiva.
Original:
The positive difference value.
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.
