Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-63
Return to Section 2 topics 2600S-901-01 Rev. A / May 2006
Math library functions
This library is an interface to most of the functions of the ANSI C math library. All
trigonometric functions work in radians. The functions
math.deg() and
math.rad() convert between radians and degrees.
string.lower(s)
Returns a copy of the string s with all uppercase letters
changed to lowercase.
string.rep(s, n)
Returns a string that is the concatenation of n copies of the
string s.
string.sub(s, i [,j])
Returns the substring of s that starts at i and continues until j.
i and j may be negative. If j is absent, then it is assumed to
be equal to –1, which is the same as the string length. In
particular, the call
string.sub(s,1,j) returns a prefix s
with length j, and
string.sub(s, -i) returns a suffix s with
length i.
string.upper(s)
Returns a copy of the string s with all lowercase letters
changed to uppercase.
math.abs(x)
Returns the absolute value of the argument x.
math.acos(x)
Returns the principal value of the trigonometric arc cosine
function of x.
math.asin(x)
Returns the principal value of the trigonometric arc sine function
of x.
math.atan(x)
Returns the principal value of the trigonometric arc tangent
function of x.
math.atan2(y,x)
Returns the principal value of the trigonometric arc tangent
function of y/x.
math.ceil(x)
Returns the smallest floating-point number not less than x whose
value is an exact mathematical integer.
math.cos(x)
Returns the trigonometric cosine function of x.
math.deg(x)
Returns the value of x in degrees, where x is in radians.
math.exp(x)
Returns the exponential function of x; that is, e
x
, where e is the
base of the natural logarithms.
math.floor(x)
Returns the largest floating-point number not greater than x
whose value is an exact mathematical integer.
math.log(x)
Returns the natural logarithm function of x.
math.log10(x)
Returns the base-10 logarithm function of x.
math.max(x, y, …)
Returns the maximum value of its numeric argument(s).
math.min(x, y, …)
Returns the minimum value of its argument(s).
math.mod(x, y)
Returns an approximation to the mathematical value f such that f
has the same sign as x, the absolute value of f is less than the
absolute value of y, and there exists an integer k such that k*y+f
= x.