Operators


Operators are used to perform specific mathematical, relational or logical operation. Examples:
10 LET X = Y + 2 / (B - 2)
20 IF A >= 10  THEN B = 4;
30 IF A >= (10*B)/T  THEN B = 4 + 9;

Arithmetic operators

 Operator      Name        Example   
 +Addition X + 10
 -Subtract X - 10
 *Multiply X * Y
 /Division X / 2
 %Modulus X % 10

Compare

Is used with the IF THEN statements

 Operator      Name        Example   
 >Greater than X > 10
 <Less than X < 10
 >=Greater than or equal X >= 10
 <=Less than or equalX <= 10
 =Equal X = Y
 <>Not equal X <> 2

Mathematical functions


SIN(), COS() and TAN() can take a number or variable and create a result. Result is in radians.
 Operator        Name      Example   
 SINSine function LET X = SIN(B)
 COSCosine function LET X = COS(B)
 TANTangent function LET X = TAN(B)
10 LET P = 3.14
10 LET A = SIN(P)
10 LET B = COS(P)
10 LET C = TAN(3.14)
10 PRINT A
10 PRINT B
10 PRINT C

To convert radians to degree:

  angle in radians * 180/pi = angle in degrees

, where pi is about 3.14

Next