1 BC
Class Ax.math.bc
Method Summary
Method Detail
Ax.math.bc.abs
-
static object Ax.math.bc.abs( object n1 )
- Info:
-
Returns the absolute value of the number. - Parameters:
- n1 - the number
- Returns:
- object
Ax.math.bc.add
-
static object Ax.math.bc.add( object numbers )
- Info:
-
Returns the sum of the parameters - Parameters:
- numbers - the numbers to add
- Returns:
- object
Ax.math.bc.compareTo
-
static smallint Ax.math.bc.compareTo( object n1, object n2 )
- Info:
-
Checks if n1 is bigger, equal or less than n2. - Parameters:
- n1 - the first number to check
- n2 - the second number to check
- Returns:
- smallint
Ax.math.bc.div
-
static object Ax.math.bc.div( object n1, object n2 )
- Info:
-
Returns the division of 2 numbers. - Parameters:
- n1 - the dividend
- n2 - the divisor
- Returns:
- object
Ax.math.bc.div
-
static object Ax.math.bc.div( object n1, object n2, smallint scale )
- Info:
-
Returns the division of 2 numbers, with the specified scale (number of digits after the decimal point/comma). - Parameters:
- n1 - the dividend
- n2 - the divisor
- scale - the scale of the quotient to be returned
- Returns:
- object
Ax.math.bc.div
-
static object Ax.math.bc.div( object n1, object n2, smallint scale, string roundingMode )
- Info:
-
Returns the division of 2 numbers, with the specified scale (number of digits after the decimal point/comma) and rounding mode. - Parameters:
- n1 - the dividend
- n2 - the divisor
- scale - the scale of the quotient to be returned
- roundingMode - the rounding mode: UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UNNECESSARY
- Returns:
- object
Ax.math.bc.equals
-
static boolean Ax.math.bc.equals( object n1, object n2 )
- Info:
-
Checks if both numbers have the same value - Parameters:
- n1 - the first number to check
- n2 - the second number to check
- Returns:
- boolean
Ax.math.bc.getScale
-
static smallint Ax.math.bc.getScale( object n1 )
- Info:
-
Gets the scale of the number, that is, sets the number of digits after the decimal point/comma. - Parameters:
- n1 - the number
- Returns:
- smallint
Ax.math.bc.isZero
-
static boolean Ax.math.bc.isZero( object n1 )
- Info:
-
Checks if n1's value is 0. - Parameters:
- n1 - number to check
- Returns:
- boolean
Ax.math.bc.mul
-
static object Ax.math.bc.mul( object numbers )
- Info:
-
Returns the multiplication of all tne numbers - Parameters:
- numbers - the numbers to multiply
- Returns:
- object
Ax.math.bc.of
-
static object Ax.math.bc.of( string number )
- Info:
-
Returns a BigDecimal from a String. - Parameters:
- number - number in String format
- Returns:
- object
Ax.math.bc.of
-
static object Ax.math.bc.of( object number )
- Info:
-
Returns a BigDecimal from a Number. - Parameters:
- number - number in Number format
- Returns:
- object
Ax.math.bc.pow
-
static object Ax.math.bc.pow( object n1, smallint n2 )
- Info:
-
Returns n1 raised to the power of n2. - Parameters:
- n1 - the base number
- n2 - the exponent
- Returns:
- object
Ax.math.bc.round
-
static object Ax.math.bc.round( object n1, smallint precision )
- Info:
-
Returns n1 rounded with the defined precision (number of digits). - Parameters:
- n1 - the number to round
- precision - the precision to use
- Returns:
- object
Ax.math.bc.scale
-
static object Ax.math.bc.scale( object n1, smallint scale )
- Info:
-
Scales the number, that is, sets the number of digits after the decimal point/comma. - Parameters:
- n1 - the number to scale
- scale - the scale to use
- Returns:
- object
Ax.math.bc.scale
-
static object Ax.math.bc.scale( object n1, smallint scale, object mode )
- Info:
-
Scales the number, that is, sets the number of digits after the decimal point/comma. - Parameters:
- n1 - the number to scale
- scale - the scale to use
- mode - the rounding mode: UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UNNECESSARY
- Returns:
- object
Ax.math.bc.sub
-
static object Ax.math.bc.sub( object numbers )
- Info:
-
Returns the subtraction of all the parameters from the first. - Parameters:
- numbers - numbers to subtract, numbers[0] is the value the other numbers will subtract from
- Returns:
- object
Ax.math.bc.unscaledValue
-
static object Ax.math.bc.unscaledValue( object n1 )
- Info:
-
Returns a number whose value is the unscaled value of n1. - Parameters:
- n1 - the number to unscale
- Returns:
- object
2 Number
Class Ax.math.Number
Constructor Summary
Method Summary
Constructor Detail
Ax.math.Number.JSNumber
-
Ax.math.Number.JSNumber()
Method Detail
Ax.math.Number.toBigDecimal
-
object Ax.math.Number.toBigDecimal( object n )
- Info:
-
Returns the Number as an BigDecimal. - Parameters:
- n - the number to convert
- Returns:
- object
Ax.math.Number.toBigInteger
-
object Ax.math.Number.toBigInteger( object n )
- Info:
-
Returns the Number as an BigInteger. - Parameters:
- n - the number to convert
- Returns:
- object
Ax.math.Number.toInt
-
smallint Ax.math.Number.toInt( object n )
- Info:
-
Returns the Number as an integer. - Parameters:
- n - the number to convert
- Returns:
- smallint
Ax.math.Number.toLong
-
long Ax.math.Number.toLong( object n )
- Info:
-
Returns the Number as a long. - Parameters:
- n - the number to convert
- Returns:
- long
3 BigDecimal
Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale.
BigDecimal documentation page.
4 BigInteger
Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in two's-complement notation (like Java's primitive integer types).