##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# remainder

From cppreference.com
< c‎ | numeric‎ | math

Defined in header `<math.h>` |  |
float remainderf( float x, float y ); |  | (since C99)
double remainder( double x, double y ); |  | (since C99)
long double remainderl( long double x, long double y ); |  | (since C99)

Computes the signed remainder of the floating point division operation x/y.

Specifically, the returned value is x - n*y, where `n` is x/y rounded to the nearest integer, or the nearest even integer if x/y is halfway between two integers.

In contrast to fmod(), the returned value is not guaranteed to have the same sign as `x`.

If the returned value is `0`, it will have the same sign as `x`.

### [edit] Parameters

x, y | - | floating point values

### [edit] Return value

Remainder of dividing arguments

### [edit] See also

fmod | remainder of the floating point division operation (function) [edit]
div ldiv lldiv imaxdiv (C99) | the quotient and remainder of integer division (function) [edit]
C++ documentation for remainder

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/math/remainder&oldid=66700"