public class NumberFunctions extends Object
Standard library specification
Constructor and Description |
---|
NumberFunctions()
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
Decimal |
abs(ExecutionContext ctx,
Decimal number)
Returns the absolute value of the
number . |
Decimal |
max(ExecutionContext ctx,
Decimal... values)
Computes max long from all passed long
|
Decimal |
min(ExecutionContext ctx,
Decimal... values)
Computes min long from all passed long
|
Decimal |
random()
Returns a pseudorandom, uniformly distributed decimal value between 0.0 (inclusive) and 1.0
(exclusive).
|
Decimal |
random(ExecutionContext ctx,
Decimal upperBound)
Returns a pseudorandom, uniformly distributed decimal value between 0 (inclusive) and the
upperBound (exclusive).
|
Decimal |
roundCeiling(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards positive infinity.
|
Decimal |
roundDown(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards zero.
|
Decimal |
roundFloor(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards negative infinity.
|
Decimal |
roundHalfDown(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards the nearest neighbour, if both neighbors are
equidistant, rounds down.
|
Decimal |
roundHalfEven(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards the nearest neighbour, if both neighbors are
equidistant, rounds towards the even neighbor.
|
Decimal |
roundHalfUp(ExecutionContext ctx,
Decimal number)
Returns rounding of the number towards the nearest neighbour, if both neighbors are
equidistant, rounds up.
|
Decimal |
roundUp(ExecutionContext ctx,
Decimal number)
Returns rounding of the number away from zero.
|
Decimal |
scale(ExecutionContext ctx,
Decimal number)
Returns the scale of the number.
|
public Decimal min(ExecutionContext ctx, Decimal... values) throws ErrorException
ctx
- values
- ErrorException
public Decimal max(ExecutionContext ctx, Decimal... values) throws ErrorException
ctx
- values
- ErrorException
public Decimal abs(ExecutionContext ctx, Decimal number) throws ErrorException
number
.ctx
- number
- number
ErrorException
public Decimal roundFloor(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundCeiling(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundDown(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundUp(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundHalfDown(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundHalfEven(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal roundHalfUp(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal scale(ExecutionContext ctx, Decimal number) throws ErrorException
ctx
- number
- ErrorException
public Decimal random()
public Decimal random(ExecutionContext ctx, Decimal upperBound) throws ErrorException
ctx
- upperBound
- ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.