Modifier and Type | Field and Description |
---|---|
(package private) static long |
SQRT_MAX_VALUE
Value representing: floor(sqrt(Long.MAX_VALUE))
|
Modifier and Type | Method and Description |
---|---|
static long |
square(ScaleMetrics scaleMetrics,
DecimalRounding rounding,
long uDecimal)
Calculates the square
uDecimal^2 / scaleFactor applying the
specified rounding for truncated decimals. |
static long |
square(ScaleMetrics scaleMetrics,
long uDecimal)
Calculates the square
uDecimal^2 / scaleFactor without rounding. |
static long |
squareChecked(DecimalArithmetic arith,
DecimalRounding rounding,
long uDecimal)
Calculates the square
uDecimal^2 / scaleFactor applying the
specified rounding for truncated decimals. |
static long |
squareChecked(DecimalArithmetic arith,
long uDecimal)
Calculates the square
uDecimal^2 / scaleFactor truncating the
result if necessary. |
static final long SQRT_MAX_VALUE
public static final long square(ScaleMetrics scaleMetrics, long uDecimal)
uDecimal^2 / scaleFactor
without rounding.
Overflows are silently truncated.scaleMetrics
- the scale metrics defining the scaleuDecimal
- the unscaled decimal value to squarepublic static final long square(ScaleMetrics scaleMetrics, DecimalRounding rounding, long uDecimal)
uDecimal^2 / scaleFactor
applying the
specified rounding for truncated decimals. Overflows are silently
truncated.scaleMetrics
- the scale metrics defining the scalerounding
- the rounding to apply for truncated decimalsuDecimal
- the unscaled decimal value to squarepublic static final long squareChecked(DecimalArithmetic arith, long uDecimal)
uDecimal^2 / scaleFactor
truncating the
result if necessary. Throws an exception if an overflow occurs.arith
- the arithmetic associated with the valueuDecimal
- the unscaled decimal value to squarepublic static final long squareChecked(DecimalArithmetic arith, DecimalRounding rounding, long uDecimal)
uDecimal^2 / scaleFactor
applying the
specified rounding for truncated decimals. Throws an exception if an
overflow occurs.arith
- the arithmetic associated with the valuerounding
- the rounding to apply for truncated decimalsuDecimal
- the unscaled decimal value to square