Formatter.util.number Class
Number utility functions.
Item Index
Methods
- isSigned static
- isSymbolicNumber static
- round static
- signedInt static
- twosComplement static
Properties
- MAX_INT static
- MAX_SIGNED_INT static
- MIN_SIGNED_INT static
Methods
isSigned
-
arg
Returns true if the given number is less than zero or negative zero.
Parameters:
-
argNumber
Returns:
isSymbolicNumber
-
arg
Returns true if the given argument represents a symbolic number (NaN, POSITIVEINFINITY, NEGATIVEINFINITY), false otherwise.
Parameters:
-
argNumber
Returns:
round
-
arg -
[precision=0]
Returns the given argument rounded to the given precision.
Parameters:
-
argNumberNumber to be rounded
-
[precision=0]Number optionalNumber of precise fractional digits. A falsy value specifies fractional precision of 0.
Returns:
signedInt
-
arg
Returns the given argument as a Number within the range [Formatter.util.number.MINSIGNEDINT, Formatter.util.number.MAXSIGNEDINT].
Parameters:
-
argNumber
Returns:
twosComplement
-
arg
Returns a decimal integer representing two's complement of the given number.
A JavaScript Number is a double-precision floating-point as specified by the IEEE 754 standard. All positive integers up to 2^53 are represented precisely, numbers beyond that threshold get their least significant bits clipped (((Math.pow(2,53) + 1) - Math.pow(2,53) results to 0, not 1).
The argument is therefore interpreted as an integer within the range [-2^52, 2^52-1]. A floating point argument is truncated, an argument out of the expected range is set to the smallest or to the greatest precise value depending on whether the argument is smaller than -2^52 or greater than 2^52-1.
Parameters:
-
argNumber
Returns:
Properties
MAX_INT
Number
final
static
Greatest precise integer value in JavaScript.
MAX_SIGNED_INT
Number
final
static
Greatest precise integer value in two's complement range.
MIN_SIGNED_INT
Number
final
static
Smallest precise integer value in two's complement range.
