
RPBASIC-52 PROGRAMMING GUIDE
2-111
TAN
Syntax: TAN(expr)
Function: Returns the trigonometric tan gent (sin/cos) of expr which is assu med to be in radian s. expr must be
in the range of +/- 200,000.
Mode: Command, run
Use: PRINT TAN(PI/4)
Cards: All
DESCRIPTION
SIN, COS, and TAN operators use a Taylor series to calculate the function. These operators first reduce the
argument to a value that is between 0 and PI/2. the algorithm used to reduce the value will reduce accuracy
when value is large. To maintain accuracy, keep the arguments for trig functions as small as possible.
ERRORS
ARITH. UNDERFLOW value or result is less than RPBASIC-52's smallest floating-point value of ± 1E-127
ARITH. OVERFLOW value or result is greater than RPBASIC-52's largest floating-point value of
±.9999999E+127
DIVIDE BY ZERO Attempt to take TAN(X) when COS(PI/2) = 0
EXAMPLES
100 PRINT SIN(PI/2),COS(10001*PI),TAN(5*PI/4)
110 PRINT ATN(TAN(PI/4))/PI
>run
1 -1 1
.24999996
Komentarze do niniejszej Instrukcji