Page 3-14
Please notice that MOD is not a function, but rather an operator, i.e., in ALG
mode, MOD should be used as y MOD x, and not as MOD(y,x). Thus, the
operation of MOD is similar to that of +, -, *, /.
As an exercise, verify that 15 MOD 4 = 15 mod 4 = residual of 15/4 = 3
Absolute value, sign, mantissa, exponent, integer and fractional parts
ABS(x) : calculates the absolute value, |x|
SIGN(x) : determines the sign of x, i.e., -1, 0, or 1.
MANT(x) : determines the mantissa of a number based on log
10
.
XPON(x) : determines the power of 10 in the number
IP(x) : determines the integer part of a real number
FP(x) : determines the fractional part of a real number
As an exercise, verify that ABS(-3) = |-3| = 3, SIGN(-5) = -1, MANT(2540) =
2.540, XPON(2540) = 3, IP(2.35) = 2, FP(2.35) = 0.35.
Rounding, truncating, floor, and ceiling functions
RND(x,y) : rounds up y to x decimal places
TRNC(x,y) :!truncate y to x decimal places
FLOOR(x) : closest integer that is less than or equal to x
CEIL(x) : closest integer that is greater than or equal to x
As an exercise, verify that RND(1.4567,2) = 1.46, TRNC(1.4567,2) = 1.45,
FLOOR(2.3) = 2, CEIL(2,3) = 3
Radians-to-degrees and degrees-to-radians functions
DR (x) : converts degrees to radians
RD (x) : converts radians to degrees.
As an exercise, verify that DR(45) = 0.78539 (i.e., 45
o
= 0.78539
rad
),
RD(1.5) = 85.943669.. (i.e., 1.5
rad
= 85.943669..
o
).
Special functions
Option 11. Special functions… in the MTH menu includes the following
functions: