public abstract class DecimalMath
extends java.lang.Object
A subset of JavaScript's Math functions applicable to type decimal
.
Constructor and Description |
---|
DecimalMath() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
abs(java.math.BigDecimal x)
Return Math.abs(x).
|
static java.math.BigDecimal |
ceil(java.math.BigDecimal x)
Return Math.ceil(x).
|
static java.math.BigDecimal |
floor(java.math.BigDecimal x)
Return Math.floor(x).
|
static java.math.BigDecimal |
max(java.math.BigDecimal x,
java.math.BigDecimal y)
Return Math.max(x, y).
|
static java.math.BigDecimal |
min(java.math.BigDecimal x,
java.math.BigDecimal y)
Return Math.min(x, y).
|
static java.math.BigDecimal |
round(java.math.BigDecimal x)
|
static java.math.BigDecimal |
round(java.math.BigDecimal x,
int scale)
Return Math.round(x).
|
static int |
sign(java.math.BigDecimal x)
Return Math.sign(x).
|
public static java.math.BigDecimal abs(java.math.BigDecimal x)
Return Math.abs(x).
x
- Argument value.public static java.math.BigDecimal ceil(java.math.BigDecimal x)
Return Math.ceil(x).
x
- Argument value.public static java.math.BigDecimal floor(java.math.BigDecimal x)
Return Math.floor(x).
x
- Argument value.public static java.math.BigDecimal max(java.math.BigDecimal x, java.math.BigDecimal y)
Return Math.max(x, y).
x
- First argument.y
- Second argument.public static java.math.BigDecimal min(java.math.BigDecimal x, java.math.BigDecimal y)
Return Math.min(x, y).
x
- First argument.y
- Second argument.public static java.math.BigDecimal round(java.math.BigDecimal x)
public static java.math.BigDecimal round(java.math.BigDecimal x, int scale)
Return Math.round(x).
x
- Argument value.scale
- Decimal scale (number of fractional digits after the decimal point).