> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/mega-extension-pack/numerics.md).

# Numerics

#### **Rounding**

* `Round()` — Rounds the float value to the nearest integer and returns it.
* `Ceil()` — Rounds the float value upwards to the nearest integer and returns it.
* `Floor()` — Rounds the float value downwards to the nearest integer and returns it.

***

#### **Distance To**

* `DistanceTo(int target)` — Returns the absolute distance between two integer values.
* `DistanceTo(float target)` — Returns the absolute distance between two float values.

***

#### **Clamp**

* `Clamp(int min, int max)` — Clamps an integer value between a minimum and maximum.
* `Clamp(float min, float max)` — Clamps a float value between a minimum and maximum.
* `Clamp01()` — Clamps a float value between 0 and 1.

***

#### **Abs**

* `Abs()` — Returns the absolute value of an integer or float.

***

#### **Sign**

* `Sign()` — Returns the sign of an integer or float (-1, 0, 1).

***

#### **Approximately**

* `Approximately(float other, float tolerance = 0.0001f)` — Checks if a float value is approximately equal to another within a specified tolerance.

***

#### **To Radians/Degrees**

* `ToRadians()` — Converts the value from degrees to radians.
* `ToDegrees()` — Converts the value from radians to degrees.

***

#### **In Range (Is Between)**

* `InRange(int minInclusive, int maxInclusive)` — Checks if the value is within the inclusive range \[minInclusive, maxInclusive].
* `InRange(float minInclusive, float maxInclusive)` — Checks if the value is within the inclusive range \[minInclusive, maxInclusive].
* `IsBetween(int minExclusive, int maxExclusive)` — Checks if the value is strictly between minExclusive and maxExclusive.
* `IsBetween(float minExclusive, float maxExclusive)` — Checks if the value is strictly between minExclusive and maxExclusive.

***

#### **To Time (Float)**

* `ToMinutes()` — Converts seconds to minutes.
* `ToHours()` — Converts seconds to hours.
* `ToTimeAsSS()` — Converts seconds to string in "SS" format.
* `ToTimeAsHHMM()` — Converts seconds to string in "HH:MM" format.
* `ToTimeAsMMSS()` — Converts seconds to string in "MM:SS" format.
* `ToTimeAsHHMMSS()` — Converts seconds to string in "HH:MM:SS" format.

***

#### **Utility**

* `IsEven()` — Checks if the integer or float value is even.
* `IsOdd()` — Checks if the integer or float value is odd.
* `IsPowerOfTwo()` — Checks if the integer value is a power of two.
