Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
(+see c)
m (same)
Line 13: Line 13:
 
}}
 
}}
 
{{dcl | since=c++11 |num=4|
 
{{dcl | since=c++11 |num=4|
Promoted    remainder( Arithmetic x, Arithmetic y );
+
Promoted    remainder( Arithmetic1 x, Arithmetic2 y );
 
}}
 
}}
 
{{dcl end}}
 
{{dcl end}}

Revision as of 12:53, 24 September 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( Arithmetic1 x, Arithmetic2 y );
(4) (since C++11)

Computes the remainder of the floating point division operation x/y. In difference to std::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.

See also

(C++11)(C++11)
remainder of the floating point division operation
(function) [edit]
computes quotient and remainder of integer division
(function) [edit]
C documentation for remainder