MQL4 Reference MQL5 features MQL5 functions Math Functions

Mathematical Functions

A set of mathematical and trigonometric functions.

Function

Action

MathAbs

Returns absolute value (modulus) of the specified numeric value

MathArccos

Returns the arc cosine of x in radians

MathArcsin

Returns the arc sine of x in radians

MathArctan

Returns the arc tangent of x in radians

MathCeil

Returns integer numeric value closest from above

MathCos

Returns the cosine of a number

MathExp

Returns exponent of a number

MathFloor

Returns integer numeric value closest from below

MathLog

Returns natural logarithm

MathLog10

Returns the logarithm of a number by base 10

MathMax

Returns the maximal value of the two numeric values

MathMin

Returns the minimal value of the two numeric values

MathMod

Returns the real remainder after the division of two numbers

MathPow

Raises the base to the specified power

MathRand

Returns a pseudorandom value within the range of 0 to 32767

MathRound

Rounds of a value to the nearest integer

MathSin

Returns the sine of a number

MathSqrt

Returns a square root

MathSrand

Sets the starting point for generating a series of pseudorandom integers

MathTan

Returns the tangent of a number

MathIsValidNumber

Checks the correctness of a real number

MathExpm1

Returns the value of the expression MathExp(x)-1

MathLog1p

Returns the value of the expression MathLog(1+x)

MathArccosh

Returns the hyperbolic arccosine

MathArcsinh

Returns the hyperbolic arcsine

MathArctanh

Returns the hyperbolic arctangent

MathCosh

Returns the hyperbolic cosine

MathSinh

Returns the hyperbolic sine

MathTanh

Returns the hyperbolic tangent

MathSwap

Change the order of bytes in the ushort/uint/ushort types value