math.cos() function

The math.cos() function returns the cosine of the radian argument x.

*Output data type: Float*

  1. import "math"
  2. math.cos(x: 3.14)
  3. // Returns -0.9999987317275396

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.cosInf) // Returns NaN
  2. math.cos(NaN) // Returns NaN