MQL4 Reference Math Functions MathMod

MathMod

The function returns the real remainder of division of two numbers.

double  MathMod(
   double  value,      // dividend value
   double  value2      // divisor value
   );

Parameters

value

[in]  Dividend value.

value2

[in]  Divisor value.

Return Value

The MathMod function calculates the real remainder f from expression val/y so that val = i * y + f , where i is an integer, f has the same sign as val, and the absolute value of f is less than the absolute value of y.

Note

Instead of MathMod() you can use fmod().