Cos Procedure
Returns the cosine of the given angle
x, which is specified in radians.
To specify an angle in degrees, multiply the angle by
PI/180 to get the equivalent in radians.
Warning: The input number is internally converted to a less precise
64-bit binary floating-point format.
The result is computed in this format and then converted back to TMBASIC's
128-bit decimal floating-point format.
These conversions may cause a loss of precision.
Declaration
function Cos(x as Number) as Number
Parameters
- x as Number — Input angle, in radians.
Return value
Number — Cosine of
x.
Example
Code
print Cos(0)
print Cos(PI)
Output