Difference between revisions of "cpp/numeric/math/remainder"
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|remainder}} | {{cpp/title|remainder}} | ||
{{cpp/numeric/math/navbar}} | {{cpp/numeric/math/navbar}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header | cmath}} |
− | {{ | + | {{dcl | notes={{mark since c++11}} |num=1| |
float remainder( float x, float y ); | float remainder( float x, float y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} |num=2| |
double remainder( double x, double y ); | double remainder( double x, double y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} |num=3| |
long double remainder( long double x, long double y ); | long double remainder( long double x, long double y ); | ||
}} | }} | ||
− | {{ | + | {{dcl | notes={{mark since c++11}} |num=4| |
Promoted remainder( Arithmetic x, Arithmetic y ); | Promoted remainder( Arithmetic x, Arithmetic y ); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
Computes the remainder of the floating point division operation {{c|x/y}}. In difference to {{rlpt|fmod}}, the return type will be negative if {{c|fmod(x, y)>y/2}}. | Computes the remainder of the floating point division operation {{c|x/y}}. In difference to {{rlpt|fmod}}, the return type will be negative if {{c|fmod(x, y)>y/2}}. | ||
Line 21: | Line 21: | ||
4) If any argument has integral type, it is cast to {{c|double}}. If any other argument is {{c|long double}}, then the return type is {{c|long double}}, otherwise it is {{c|double}} | 4) If any argument has integral type, it is cast to {{c|double}}. If any other argument is {{c|long double}}, then the return type is {{c|long double}}, otherwise it is {{c|double}} | ||
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | x, y | floating point values}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 31: | Line 31: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list fmod}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list div}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/numeric/math/remainder]] | [[de:cpp/numeric/math/remainder]] |
Revision as of 19:21, 31 May 2013
Defined in header <cmath>
|
||
float remainder( float x, float y ); |
(1) | (since C++11) |
double remainder( double x, double y ); |
(2) | (since C++11) |
long double remainder( long double x, long double y ); |
(3) | (since C++11) |
Promoted remainder( Arithmetic x, Arithmetic y ); |
(4) | (since C++11) |
Computes the remainder of the floating point division operation x/y. In difference to fmod
, the return type will be negative if fmod(x, y)>y/2.
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 values |
Return value
remainder of dividing arguments