Previous Top Next

Math Functions

ABS(number) return absolute value of number abs(-2.3) /* 2.3 */ FORMAT(number[,[before][,[after][,[expp][,expt]]]]) rounds and formats number with before integer digits and after decimal places ( expp and expt are ignored! ) format(2.66) /* 3 */ format(2.66,1,1) /* 2.7 */ MAX(number[,number]..]) returns the largest of given numbers. max(2,3,1,5) /* 5 */ MIN(number[,number]..]) returns the smallest of given numbers. min(2,3,1,5) /* 1 */ RANDOM([min][,[max][,seed]]) returns a pseudorandom nonnegative whole number in the range min to max inclusive. SIGN(number) return the sign of number ("-1","0" or "1"). sign(-5.2) /* -1 */ sign( 0.0) /* 0 */ sign( 5.2) /* 1 */ TRUNC(number(,n)) returns the integer part of number, and n decimal places. The default n is zero. trunc(2.6) /* 2 */ The following are common math functions that return one real number. + ACOS ( num ) Arc-cosine + ASIN ( num ) Arc-sine + ATAN ( num ) Arc-tangent + COS ( num ) Cosine + COSH ( num ) Hyperbolic cosine + EXP ( num ) Exponiate + LOG ( num ) Natural logarithm + LOG10( num ) Logarithm of base 10 + POW10( num ) Power with base 10 + SIN ( num ) Sine function + SINH ( num ) Hyperbolic sine + SQRT ( num ) Square root + TAN ( num ) Tangent + TANH ( num ) Hyperbolic tangent + + POW ( a,b ) raises a to power b

Previous Top Next