> For the complete documentation index, see [llms.txt](https://zaidlang.gitbook.io/z/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zaidlang.gitbook.io/z/standard-library/math.md).

# Math

Provides basic constants and mathematical functions.

### Methods <a href="#methods" id="methods"></a>

#### `math.abs()` <a href="#mathabs" id="mathabs"></a>

Returns the absolute, or non-negative value, of a given value.

```go
math.abs(-100)

// expected value: 100
```

#### `math.cos()` <a href="#mathcos" id="mathcos"></a>

Returns the cosine of the radian argument.

```go
math.cos(math.pi / 2).round()

// expected value: 0
```

#### `math.isNegative()` <a href="#mathisnegative" id="mathisnegative"></a>

Determines if the specified value is negative.

```go
math.isNegative(-100)

// expected value: true
```

#### `math.isPositive()` <a href="#mathispositive" id="mathispositive"></a>

Determines if the specified value is positive.

```go
math.isPositive(100)

// expected value: true
```

#### `math.isZero()` <a href="#mathiszero" id="mathiszero"></a>

Determines if the specified value is zero.

```go
math.isZero(5)

// expected value: false
```

#### `math.sin()` <a href="#mathsin" id="mathsin"></a>

Returns the sine of the radian argument.

```go
math.sin(math.pi).round()

// expected value: 0
```

#### `math.tan()` <a href="#mathtan" id="mathtan"></a>

Returns the tangent of the radian argument.

```go
math.tan(0).round()

// expected value: 0
```

### Properties <a href="#properties" id="properties"></a>

#### `math.pi` <a href="#mathpi" id="mathpi"></a>

The mathematical constant π = 3.141592…, use the `round()` method to round down to the desired precision.

```go
math.pi.round(2)

// expected value: 3.14
```

#### `math.e` <a href="#mathe" id="mathe"></a>

The mathematical constant e = 2.718281…, use the `round()` method to round down to the desired precision.

```go
math.e.round(2)

// expected value: 2.72
```

#### `math.epsilon` <a href="#mathepsilon" id="mathepsilon"></a>

The mathematical constant 𝜀 = 2.220446049250e-16, represents the smallest value that a float can have different from zero.

```go
math.epsilon

// expected value: 0.00000000000000022204460492503130808472633361816
```

#### `math.tau` <a href="#mathtau" id="mathtau"></a>

The mathematical constant τ = 6.283185…, use the `round()` method to round down to the desired precision.

```go
math.tau.round(2)

// expected value: 6.28
```
