docs-v2/content/v2.0/reference/flux/stdlib/math/cos.md

37 lines
588 B
Markdown

---
title: math.cos() function
description: The math.cos() function returns the cosine of the radian argument `x`.
aliases:
- /v2.0/reference/flux/functions/math/cos/
menu:
v2_0_ref:
name: math.cos
parent: Math
weight: 301
---
The `math.cos()` function returns the cosine of the radian argument `x`.
_**Output data type:** Float_
```js
import "math"
math.cos(x: 3.14)
// Returns -0.9999987317275396
```
## Parameters
### x
The value used in the operation.
_**Data type:** Float_
## Special cases
```js
math.cos(±Inf) // Returns NaN
math.cos(NaN) // Returns NaN
```