Namespaces
Variants
Views
Actions

std::remainder

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 05:39, 28 August 2013 by P12 (Talk | contribs)

 
 
 
 
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 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