Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/math/fdim"

From cppreference.com
< cpp‎ | numeric‎ | math
m (Text replace - "/sidebar" to "/navbar")
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh)
Line 37: Line 37:
 
{{dcl list template | cpp/numeric/math/dcl list fmax}}
 
{{dcl list template | cpp/numeric/math/dcl list fmax}}
 
{{dcl list end}}
 
{{dcl list end}}
 +
 +
[[de:cpp/numeric/math/fdim]]
 +
[[es:cpp/numeric/math/fdim]]
 +
[[fr:cpp/numeric/math/fdim]]
 +
[[it:cpp/numeric/math/fdim]]
 +
[[ja:cpp/numeric/math/fdim]]
 +
[[pt:cpp/numeric/math/fdim]]
 +
[[ru:cpp/numeric/math/fdim]]
 +
[[zh:cpp/numeric/math/fdim]]

Revision as of 22:07, 2 November 2012

 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cmath>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
float       fdim( float x, float y );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double      fdim( double x, double y );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
long double fdim( long double x, long double y );
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
Promoted    fdim( Arithmetic x, Arithmetic y );
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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.

See also

Template:cpp/numeric/math/dcl list absTemplate:cpp/numeric/math/dcl list fmax