fmod

Computes the floating-point remainder of x/y.

Library:LibC
Classification:ANSI
Service:Math

Syntax

  #include <math.h> 
   
  double fmod (
     double   x,
     double   y);
  

Parameters

x and y

(IN) Specifies the arguments for which the floating-point remainder is to be computed.

Return Values

Returns the value x - ( i * y), for some integer i such that, if y is nonzero, the result has the same sign as x and a magnitude less than the magnitude of y.

If the value of y is zero, the value returned is zero.

Remarks

The fmod function computes the floating-point remainder of x / y, even if the quotient x / y is not representable.

See Also