Documentation › Modules › Math.em

File: Math.em

Mathematic functions for your enjoyment

Last modified: 08/31/2015

ACos( x )#

Parameters

x Real, in radians

Explanation

Computes the arccosine of x

Return values

Real number in radians

Errors

  • "Invalid parameter type"

ASin( x )#

Parameters

x Real, in radians

Explanation

Computes the arcsine of x

Return values

Real number in radians

Errors

  • "Invalid parameter type"

ATan( x )#

Parameters

x Real, in radians

Explanation

Computes the arctangent of x

Return values

Real number in radians

Errors

  • "Invalid parameter type"

Abs( x )#

Parameters

x Real or Integer

Explanation

Computes the absolute value of x

Return values

Real number

Errors

  • "Invalid parameter type"

Ceil( x )#

Parameters

x Real

Explanation

Computes the ceiling of x

Return values

Real that is smallest integer >= x

Errors

  • "Invalid parameter type"

ConstE()#

Explanation

Returns an approximation of the trancendental number E
e, is an irrational NUMBER occurring widely in mathematics and science, approximately equal to the value 2.71828; it is the base of natural, or Naperian, LOGARITHMS. Like pi, e is transcendental, i.e., not a ROOT of any algebraic equation. It is defined as the LIMIT of the expression (1 + 1/n)^n as n becomes infinitely large. Expressions of the form e^(x), known as the exponential function, occur in applications ranging from statistics to nuclear physics

Return values

Real number

ConstPi()#

Explanation

Returns an approximation of the trancendental number Pi
Pi is a numerical constant that represents the ratio of a circle's circumference to its diameter on a flat plane surface. The value is the same regardless of the size of the circle. The decimal expansion of pi is a nonterminating, nonrepeating sequence of digits. Pi can be expressed through the Fourier series pi = 4 - (4/3) + (4/5) - (4/7) + (4/9) - ...

Return values

Real number (3.14159....)

Cos( x )#

Parameters

x Real, in radians

Explanation

Computes the cosine of x

Return values

Real number

Errors

  • "Invalid parameter type"

DegToRad( degrees )#

Parameters

degrees Real, in degrees

Explanation

Converts the degrees parameter to radians

Return values

Real number in radians

Errors

  • "Invalid parameter type"

Floor( x )#

Parameters

x Real

Explanation

Computes the floor of x

Return values

Real that is largest integer <= x

Errors

  • "Invalid parameter type"

FormatRealToString( value, precision )#

Parameters

value Real
precision Integer

Explanation

Formats a Double into a string. WARNING: this may produce different output on Windows and Linux, output is intended only for displaying and informational purposes. Do not rely on it to be accurate, to do not change in time, or to fit into any specifiec or predictable format.

Return values

String rep of the real number

Errors

  • "Invalid parameter type"

Log10( x )#

Parameters

x Real

Explanation

Computes log(base 10) of x

Return values

Real number

Errors

  • "Invalid parameter type"

LogE( x )#

Parameters

x Real

Explanation

Computes the natural log of x

Return values

Real number

Errors

  • "Invalid parameter type"

Max( x, y:=0 )#

Parameters

x Integer/Double/Array
y Integer/Double

Explanation

The numerically highest Integer of the parameter values. Will return int/dbl based on parameter types passed.
If first param is an Array second will be ignored and returns lowest int/dbl entry.

Return values

Integer/Double

Errors

  • "Invalid parameter type"
  • "Array empty"
  • "No Integer/Double elements"

Min( x, y:=0 )#

Parameters

x Integer/Double/Array
y Integer/Double

Explanation

The numerically lowest Integer of the parameter values. Will return int/dbl based on parameter types passed.
If first param is an Array second will be ignored and returns lowest int/dbl entry.

Return values

Integer/Double

Errors

  • "Invalid parameter type"
  • "Array empty"
  • "No Integer/Double elements"

Pow(x, y )#

Parameters

x Real
y Real

Explanation

Computes x ^ y

Return values

Real number

Errors

  • "Invalid parameter type"

RadToDeg( radians )#

Parameters

radians Real, in radians

Explanation

Converts the radian parameter to degrees

Return values

Real number in degrees

Errors

  • "Invalid parameter type"

Root(x, y )#

Parameters

x Real
y Real

Explanation

Computes the y root of x (same as Pow(x,1.0/y)).

Return values

Real number

Errors

  • "Invalid parameter type"

Sin( x )#

Parameters

x Real, in radians

Explanation

Computes the sine of x

Return values

Real number

Errors

  • "Invalid parameter type"

Sqrt( x )#

Parameters

x Real

Explanation

Computes the square root of x

Return values

Real number

Errors

  • "Invalid parameter type"

Tan( x )#

Parameters

x Real, in radians

Explanation

Computes the tangent of x

Return values

Real number

Errors

  • "Invalid parameter type"