MathUtil
Math helper with static function for integer operations
Static Method Summary
Static Public Methods | ||
public static |
compareNumbers(a: number, b: number): number Compares two Numbers. |
|
public static |
floorDiv(x: number, y: number): number |
|
public static |
floorMod(x: number, y: number): number |
|
public static |
hash(number: *): * |
|
public static |
hashCode(numbers: ...*): * |
|
public static |
intDiv(x: number, y: number): number |
|
public static |
intMod(x: number, y: number): number |
|
public static |
parseInt(value: number): number |
|
public static |
roundDown(r: number): number |
|
public static |
safeAdd(x: number, y: number): number |
|
public static |
safeMultiply(x: number, y: number): number |
|
public static |
safeSubtract(x: number, y: number): number |
|
public static |
safeToInt(value: number): number |
|
public static |
safeZero(value: number): number convert -0 to 0 and int as string to a number ( '1' -> 1 ) |
|
public static |
smi(int: *): * |
|
public static |
verifyInt(value: number) |
Static Public Methods
public static compareNumbers(a: number, b: number): number source
Compares two Numbers.
Params:
Name | Type | Attribute | Description |
a | number | the first value |
|
b | number | the second value |
Return:
number | the result |
public static floorDiv(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static floorMod(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static hashCode(numbers: ...*): * source
Params:
Name | Type | Attribute | Description |
numbers | ...* |
Return:
* |
public static intDiv(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static intMod(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static parseInt(value: number): number source
Params:
Name | Type | Attribute | Description |
value | number |
Return:
number |
public static roundDown(r: number): number source
Params:
Name | Type | Attribute | Description |
r | number |
Return:
number |
public static safeAdd(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static safeMultiply(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static safeSubtract(x: number, y: number): number source
Params:
Name | Type | Attribute | Description |
x | number | ||
y | number |
Return:
number |
public static safeToInt(value: number): number source
Params:
Name | Type | Attribute | Description |
value | number |
Return:
number |
public static safeZero(value: number): number source
convert -0 to 0 and int as string to a number ( '1' -> 1 )
Params:
Name | Type | Attribute | Description |
value | number |
Return:
number |
public static verifyInt(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |