Javatpoint Logo
Javatpoint Logo

C++ Math remainder()

The function finds the floating point remainder of numerator/denominator (rounded to the nearest integer value).

Formulae of remainder :

where, r = numerator/denominator and it is rounded to the nearest integral value.


Consider a numerator 'n' and denominator 'd'. Syntax would be:

Note: The return_type can be float, double or long double.


n: Value of the numerator.

d: Value of the denominator.

Return value

It returns the floating point remainder n/d.

Example 1

Let's see a simple example.


Values of numerator and denominator are :5.7 , 8.9
Remainder is :-3.2   

Next TopicC++ Math Functions

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA