What is fmod() Function?
The word "fmod" is the short of "for floating-point modulus". The fmod() function is used to find the remainder by dividing two real numbers. The declaration of fmod() function is as follows:double fmod (double, double);
The declaration of fmod() function indicates that two parameters both of "double" type are passed to this function. The output returned by fmod() function is also of "double" type.The general syntax to call fmod() function is as follows:
var = fmod (x, y);
In the above syntax:x
It indicates the numerator. It may be a variable, constant value or expression.y
It indicates the denominator. It may be a variable, constant value or expression.var
It indicates the variable of "double" type into which the returned value is to be assigned.For example, if x = 9.5 and y = 4.0 then fmod(x, y) will return 1.5.