Developer   API   Core & System   Math

  •  Config(0)
  •  Properties(8)
  •  Methods(16)
  •  Events(0)

Math(native)

Math object has no constructor thus you cannot create instances of it.

Properties

  • E : Float
    e - Euler's constant, the base of natural logarithms.
  • LN10 : Float
    Value of natural logarithm of 10.
  • LN2 : Float
    Value of natural logarithm of 2.
  • LOG10E : Float
    Value of base 10 logarithm of e constant.
  • LOG2E : Float
    Value of base 2 logarithm of e constant.
  • PI : Float
    Pi constant - the ratio of the circumference of a circle to its diameter.
  • SQRT1_2 : Float
    Value of square root of 0.5.
  • SQRT2 : Float
    Value of square root of 2.0.

Methods

  • abs(number) : Integer
    Calculates abs (positive) value of integer or float argument
  • acos(angle) : Float
    Calculates arccosine of its argument.
  • asin(number) : Float
    Calculates arcsine of its argument.
  • atan(number [, number] ) : Float
    Returns arctangent if its arguments.
  • ceil(number) : Integer
    Rounds a number up - returns the smallest integer greater than or equal to the argument
  • cos(angle) : Float
    Calculates value of cosine function for angle in parameter.
  • exp(number) : Float
    Returns the exponential value of the argument, if successful. On overflow, the function returns INF (infinite) and on underflow, exp returns 0.0. To test number on infinity use Float.isFinite method.
  • floor(number) : Integer
    Rounds a number down - returns the largest integer that is less than or equal to the argument
  • log(number) : Float
    Calculate natural logarithms of the argument. If argument is negative, these functions throws an exception.
  • log10(number) : Float
    The log functions return common (base-10) logarithm of the argument if successful. If argument is negative, these functions throws an exception.
  • log2(number) : Float
    The log functions return base-2 logarithms of the argument if successful. If argument is negative, these functions throws an exception.
  • pow(number, exponent) : Float
    Calculates number raised to the power of exponent: result = number^exponent;
  • round(number) : Integer
    Mathematically rounds a number.
  • sin(angle) : Float
    Calculates value of sine function for angle in parameter.
  • sqrt(number) : Float
    Returns the square root of the argument.
  • tan(angle) : Float
    Calculates value of tanget function for angle in parameter.

Remarks

Consider Math as a namespace - collection of static methods and constants.

API Navigation
Skip Navigation Links.
Expand <span>User Interface</span> User Interface
Collapse <span>Core & System</span> Core & System
System
Object
Integer
Float
String
Date
Math
Array
RegExp
Global
Function
Timer
Expand <span>Graphics</span> Graphics
Expand <span>Files and Databases</span> Files and Databases
Expand <span>Crypto</span> Crypto
Expand <span>Native User Interface</span> Native User Interface
Expand <span>Net</span> Net
Expand <span>Media</span> Media
Expand <span>Sensor</span> Sensor
Expand <span>Game Development</span> Game Development