XNumber
in package
FinalYes
Provides various helper methods for numbers.
Table of Contents
Constants
- BASE62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
Methods
- almostEquals() : bool
- easeInQuad() : float
- easeOutQuad() : float
- fromBase62() : int|false
- Converts a base62 integer to a base10 integer.
- toBase62() : string
- Converts a base10 integer to a base62 integer.
- weighted() : float
Constants
BASE62
public
mixed
BASE62
= '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
Methods
almostEquals()
public
static almostEquals(float $value1, float $value2) : bool
Parameters
- $value1 : float
- $value2 : float
Return values
booleaseInQuad()
public
static easeInQuad(float $n) : float
Parameters
- $n : float
Return values
floateaseOutQuad()
public
static easeOutQuad(float $n) : float
Parameters
- $n : float
Return values
floatfromBase62()
Converts a base62 integer to a base10 integer.
public
static fromBase62(string $string) : int|false
Parameters
- $string : string
-
The encoded integer.
Return values
int|false —Returns the decoded integer or false on failure.
toBase62()
Converts a base10 integer to a base62 integer.
public
static toBase62(int $integer) : string
Parameters
- $integer : int
-
The integer to encode.
Return values
string —The encoded data, as a string.
weighted()
public
static weighted(float $num1, float $num2, float $weight) : float
Parameters
- $num1 : float
- $num2 : float
- $weight : float