Math Javascript library

The Math class provides to compute numbers. It returns float type. It takes 32 bits : 16 bits for integer part and 16 bits for decimal parts.
So, we cannot go up to the number 32768. If you need a wider range of number, you can use the d-methods (for double).


float cos (float v):
Returns the cosinus value of v (in radians)

float sin (float v):
Returns the sinus value of v (in radians)

float floor (float v):
Returns the closest smaller integer of the param

float ceil (float v):
Returns the closest bigger integer of the param

float sqrt (float v):
Returns the square root of the parameter

float rand (float v):
Returns a random number between 0 and 1

float abs (float v):
Returns the positive version of the parameter

float acos (float v):
Returns the arc cosinus of the parameter

float asin (float v):
Returns the arc sinus of the parameter

float atan (float v):
Returns the arc tangent of the parameter


PI:
The constant value for PI (3.141592)

E:
The constant value for E (2.71828182)



Redefines previous function for double type. Double type is not supported by Memo so it uses string type instead. It enable to have better range and precision than FixFloat.

String dadd(String d1, Stringd2):
Returns the addition of the double values contained in Strings

String dsub(String d1, Stringd2):
Returns the subtraction of the double values contained in Strings

String dmul(String d1, Stringd2):
Returns the multiplication of the double values contained in Strings

String ddiv(String d1, Stringd2):
Returns the division of the double values contained in Strings

String dsin(String d1):
Returns the sinus of the double value contained in String

String dasin(String d1):
Returns the arc sinus of the double value contained in String

String dcos(String d1):
Returns the cosinus of the double value contained in String

String dacos(String d1):
Returns the arc cosinus of the double value contained in String

String dtan(String d1):
Returns the tangent of the double value contained in String

String datan(String d1):
Returns the arc tangent of the double value contained in String

String datan2(String d1,String d2):
Returns the arc tangent 2 of the double values contained in Strings

String dfloor(String d1):
Returns the closest smaller integer of the param

boolean dsup(String d1,String d2):
Returns the true if value of d1 is greater than the value of d2, else false

boolean dsupeq(String d1,String d2):
Returns the true if value of d1 is greater or equal than the value of d2, else false

boolean dinf(String d1,String d2):
Returns the true if value of d1 is smaller than the value of d2, else false

boolean dinfeq(String d1,String d2):
Returns the true if value of d1 is smaller or equal than the value of d2, else false

String dabs(String d1):
Returns the positive version of the parameter

String dlog(String d1):
Returns the logarithm of the parameter.
Since 1.4.8