> ## Documentation Index
> Fetch the complete documentation index at: https://docs.farmtrace.co.za/llms.txt
> Use this file to discover all available pages before exploring further.

# Numeric functions

> Calculate angles, logarithms, present value, constants, and random values.

Numeric functions return finite Numeric values. Inputs outside a function's mathematical domain produce a formula error instead of `NaN` or infinity.

## `Acos`

Returns the arccosine of a number in radians.

* **Syntax:** `Acos(number)`
* **Requires:** a Numeric value from `-1` through `1`.
* **Returns:** Numeric angle in radians.
* **Best for:** geometry and calculations that start with a cosine ratio.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Acos(0.5)
```

## `Asin`

Returns the arcsine of a number in radians.

* **Syntax:** `Asin(number)`
* **Requires:** a Numeric value from `-1` through `1`.
* **Returns:** Numeric angle in radians.
* **Best for:** geometry and calculations that start with a sine ratio.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Asin(0.5)
```

## `Atan`

Returns the arctangent of a number in radians.

* **Syntax:** `Atan(number)`
* **Requires:** a Numeric value.
* **Returns:** Numeric angle in radians.
* **Best for:** slopes, bearings, and right-triangle calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Atan([Rise] / [Run])
```

## `Cos`

Returns the cosine of an angle.

* **Syntax:** `Cos(radians)`
* **Requires:** a Numeric angle in radians.
* **Returns:** Numeric.
* **Best for:** geometry, oscillation, and vector calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Cos(Radians(60))
```

## `Cot`

Returns the cotangent of an angle.

* **Syntax:** `Cot(radians)`
* **Requires:** a Numeric angle in radians where the tangent is not zero.
* **Returns:** Numeric.
* **Best for:** geometry formulas that use adjacent divided by opposite.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Cot(Radians(45))
```

## `Degrees`

Converts an angle from radians to degrees.

* **Syntax:** `Degrees(radians)`
* **Requires:** a Numeric angle in radians.
* **Returns:** Numeric angle in degrees.
* **Best for:** displaying a calculated angle in familiar units.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Degrees(Pi() / 2)
```

## `Exp`

Raises Euler's number `e` to a supplied power.

* **Syntax:** `Exp(number)`
* **Requires:** a Numeric exponent whose result remains finite.
* **Returns:** Numeric.
* **Best for:** growth, decay, and continuous compounding.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Exp(2)
```

## `Frac`

Returns the fractional part left after truncating a number toward zero.

* **Syntax:** `Frac(number)`
* **Requires:** a Numeric value.
* **Returns:** Numeric.
* **Best for:** separating whole and fractional quantities.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Frac(12.75)
```

For negative inputs, the fractional result is also negative.

## `Int`

Returns the integer part of a number by truncating toward zero.

* **Syntax:** `Int(number)`
* **Requires:** a Numeric value.
* **Returns:** whole Numeric value.
* **Best for:** extracting completed units without rounding.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Int(12.75)
```

## `Ln`

Returns the natural logarithm, using base `e`.

* **Syntax:** `Ln(number)`
* **Requires:** a positive Numeric value.
* **Returns:** Numeric.
* **Best for:** exponential models and continuous growth calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Ln(Exp(2))
```

## `Log`

Returns the base-10 logarithm.

* **Syntax:** `Log(number)`
* **Requires:** a positive Numeric value.
* **Returns:** Numeric.
* **Best for:** orders of magnitude and logarithmic scales.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Log(1000)
```

## `Pi`

Returns the mathematical constant π.

* **Syntax:** `Pi()`
* **Requires:** no arguments.
* **Returns:** Numeric.
* **Best for:** circle, angle, and periodic calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Pi() * [Radius] ^ 2
```

## `PV`

Calculates the present value of zero or more equal future payments.

* **Syntax:** `PV(rate, periodsUntilFirstPayment, payment[, paymentCount])`
* **Requires:** Numeric periodic rate, Numeric delay, Numeric payment amount, and optional non-negative whole-number payment count. The rate must be greater than `-1`. Payment count defaults to `1`.
* **Returns:** Numeric present value.
* **Best for:** discounted recurring payments and finance projections.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
PV(0.1, 1, 222, 2)
```

Use the rate per payment period—for example, a monthly rate when each period is one month. When `paymentCount` is `0`, the result is `0`.

## `Radians`

Converts an angle from degrees to radians.

* **Syntax:** `Radians(degrees)`
* **Requires:** a Numeric angle in degrees.
* **Returns:** Numeric angle in radians.
* **Best for:** preparing degree-based data for trigonometric functions.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Sin(Radians(30))
```

## `Random`

Creates a pseudo-random number for the current evaluation.

* **Syntax:** `Random()` or `Random(minimum, maximum)`
* **Requires:** no arguments, or two Numeric bounds where `maximum` is greater than `minimum`.
* **Returns:** Numeric from `0` up to but not including `1`, or from the supplied minimum up to but not including the maximum.
* **Best for:** sampling, shuffling keys, and non-security-sensitive variation.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Random()
Random(10, 20)
```

<Warning>
  Do not use `Random` for passwords, access tokens, signatures, or other security decisions.
</Warning>

## `Sin`

Returns the sine of an angle.

* **Syntax:** `Sin(radians)`
* **Requires:** a Numeric angle in radians.
* **Returns:** Numeric.
* **Best for:** geometry, oscillation, and vector calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Sin(Radians(30))
```

## `Sqrt`

Returns the square root of a number.

* **Syntax:** `Sqrt(number)`
* **Requires:** a non-negative Numeric value.
* **Returns:** Numeric.
* **Best for:** distances, standard deviation steps, and geometric calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Sqrt([Area])
```

## `Tan`

Returns the tangent of an angle.

* **Syntax:** `Tan(radians)`
* **Requires:** a Numeric angle in radians whose result remains finite.
* **Returns:** Numeric.
* **Best for:** slopes and right-triangle calculations.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Tan(Radians(45))
```

<Tip>
  Use `Radians` before `Sin`, `Cos`, `Tan`, or `Cot` when your source angle is stored in degrees.
</Tip>
