Difference between revisions of "cpp/numeric/math/fdim"
From cppreference.com
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh) |
m (Shorten template names. Use {{lc}} where appropriate.) |
||
Line 1: | Line 1: | ||
{{cpp/title|fdim}} | {{cpp/title|fdim}} | ||
{{cpp/numeric/math/navbar}} | {{cpp/numeric/math/navbar}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header | cmath}} |
− | {{ | + | {{dcl | notes={{mark since c++11}} | num=1 | |
float fdim( float x, float y ); | float fdim( float x, float y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} | num=2 | |
double fdim( double x, double y ); | double fdim( double x, double y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} | num=3 | |
long double fdim( long double x, long double y ); | long double fdim( long double x, long double y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} | num=4 | |
Promoted fdim( Arithmetic x, Arithmetic y ); | Promoted fdim( Arithmetic x, Arithmetic y ); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
Returns the positive difference between {{c|x}} and {{c|y}}. | Returns the positive difference between {{c|x}} and {{c|y}}. | ||
Line 23: | Line 23: | ||
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | x, y | floating point value}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 33: | Line 33: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list abs}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list fmax}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/numeric/math/fdim]] | [[de:cpp/numeric/math/fdim]] |
Revision as of 19:19, 31 May 2013
Defined in header <cmath>
|
||
float fdim( float x, float y ); |
(1) | (since C++11) |
double fdim( double x, double y ); |
(2) | (since C++11) |
long double fdim( long double x, long double y ); |
(3) | (since C++11) |
Promoted fdim( Arithmetic x, Arithmetic y ); |
(4) | (since C++11) |
Returns the positive difference between x and y. 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.
4) 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.
Parameters
x, y | - | floating point value |
Return value
The positive difference value.