numer | The numerator |
denom | The denominator |
Return: | Returns the floating-point remainder of numer/denom (rounded towards zero). |
The FMod function returns the floating-point remainder of numer/denom (rounded towards zero).
If denom is zero, the result depends on the divideByZero flag:
If set to 'zero' or unset: returns zero.
If set to 'nan': returns a non-signalling NaN value.
If set to 'fail': throws an exception.
Example:
#OPTION ('divideByZero', 'nan'); //divide by zero creates a quiet NaN IMPORT STD; STD.Math.FMod(5.1, 3.0); // 2.1 STD.Math.FMod(-5.1, 3.0); // -2.1 STD.Math.FMod(5.1, 0); // NaN