TAN INDEX

TAN _ _ _ _ _ _ _ _ _ _ _ _ operator

The tan operator returns the tangent of its argument.

syntax:

tan(<expression>) or tan <simple\_expression>

<expression> is any valid scalar REDUCE expression, <simple\_expression> is a single identifier or begins with a prefix operator name.

examples:


tan a; 

  TAN(A) 


tan(pi/5); 

      PI
  TAN(--) 
      5


on rounded;
tan(pi/5); 

  0.726542528005

tanreturns a numeric value only if rounded is on . Then the tangent is calculated to the current degree of floating point accuracy.

When rounded is on, no check is made to see if the argument of tan is a multiple of pi/2, for which the tangent goes to positive or negative infinity. (Of course, since REDUCE uses a fixed-point representation of pi/2, it produces a large but not infinite number.) You need to make a check for multiples of pi/2 in any program you use that might possibly ask for the tangent of such a quantity.