Home Reference Source
public class | source

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:

NameTypeAttributeDescription
a number

the first value

b number

the second value

Return:

number

the result

public static floorDiv(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static floorMod(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static hash(number: *): * source

Params:

NameTypeAttributeDescription
number *

Return:

*

public static hashCode(numbers: ...*): * source

Params:

NameTypeAttributeDescription
numbers ...*

Return:

*

public static intDiv(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static intMod(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static parseInt(value: number): number source

Params:

NameTypeAttributeDescription
value number

Return:

number

public static roundDown(r: number): number source

Params:

NameTypeAttributeDescription
r number

Return:

number

public static safeAdd(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static safeMultiply(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static safeSubtract(x: number, y: number): number source

Params:

NameTypeAttributeDescription
x number
y number

Return:

number

public static safeToInt(value: number): number source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
value number

Return:

number

public static smi(int: *): * source

Params:

NameTypeAttributeDescription
int *

Return:

*

public static verifyInt(value: number) source

Params:

NameTypeAttributeDescription
value number