# COS

Updated: 10/19/2021, 9:29:48 PM
Created: 10/19/2021, 9:29:48 PM
Last Updated By: Kevin Munoz
Read Time: 1 minute(s)

# Description

The function calculates the cosine of any angle using floating point arithmetic, then rounds to the PRECISION implied by the jBASE BASIC program, which makes it very accurate. The function takes the general form:

 COS(expression)
1

Where expression must evaluate to a numeric result or a runtime error will occur.

# Note

The function assumes the value returned by expression to be in degrees.

An example of use is as:

FOR I = 1 TO 360
    CRT COS(I)  ;* display cos i for 1 to 360 degrees
NEXT I
1
2
3

Go back to jBASE BASIC

Go back to Programmers' Reference Guide