Number operations on an implementation specific set of
Number types.
Let S be the set of possible Number values within the (given) set of
Number types.
Then S is closed
under the collection of NumberSystem's methods.
| Modifier and Type | Class and Description |
|---|---|
| public static class | NumberSystem.
Immutable value type, holder of 2 numbers. |
| Modifier and Type | Method and Description |
|---|---|
| public Number | |
| public Number | |
| public int | |
| public Number | |
| public Number[] | divideAndRemainder(Number x, Number y, boolean
- whether the division remainder should be rounded towards zero roundRemainderTowardsZero)Returns a two-element Number array containing {x / y, x % y} |
| public default boolean | |
| public Number | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Number | |
| public Number | |
| public Number | |
| public Number | |
| public Number | |
| public Number | Returns: number^-1Returns the reciprocal of given |
| public int | |
| public Number |
| abs | back to summary |
|---|---|
| public Number abs(Number number) Returns the absolute of given
| |
| add | back to summary |
|---|---|
| public Number add(Number x, Number y) Returns the sum of given
| |
| compare | back to summary |
|---|---|
| public int compare(Number x, Number y) Compares two
| |
| divide | back to summary |
|---|---|
| public Number divide(Number x, Number y) Returns the division of given
| |
| divideAndRemainder | back to summary |
|---|---|
| public Number[] divideAndRemainder(Number x, Number y, boolean roundRemainderTowardsZero) Returns a two-element Number array containing {x / y, x % y}
| |
| equals | back to summary |
|---|---|
| public default boolean equals(Number x, Number y) | |
| exp | back to summary |
|---|---|
| public Number exp(Number number) Returns Euler's Constant to the power of of given
| |
| isInteger | back to summary |
|---|---|
| public boolean isInteger(Number number) Checks whether given
| |
| isLessThanOne | back to summary |
|---|---|
| public boolean isLessThanOne(Number number) | |
| isOne | back to summary |
|---|---|
| public boolean isOne(Number number) | |
| isZero | back to summary |
|---|---|
| public boolean isZero(Number number) | |
| log | back to summary |
|---|---|
| public Number log(Number number) Returns the natural logarithm of given
| |
| multiply | back to summary |
|---|---|
| public Number multiply(Number x, Number y) Returns the product of given
| |
| narrow | back to summary |
|---|---|
| public Number narrow(Number number) 'Narrows' given
eg. A BigInteger that is within range of Java's
| |
| negate | back to summary |
|---|---|
| public Number negate(Number number) Returns the negation of given
| |
| power | back to summary |
|---|---|
| public Number power(Number number, int exponent) Returns given
| |
| reciprocal | back to summary |
|---|---|
| public Number reciprocal(Number number) Returns the reciprocal of given
| |
| signum | back to summary |
|---|---|
| public int signum(Number number) Returns the signum function of given
| |
| subtract | back to summary |
|---|---|
| public Number subtract(Number x, Number y) Returns the difference of given
| |
| Modifier and Type | Field and Description |
|---|---|
| public final Number | quotient
originating from x / y |
| public final Number | remainder
originating from x % y |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static NumberSystem. |
| quotient | back to summary |
|---|---|
| public final Number quotient originating from x / y | |
| remainder | back to summary |
|---|---|
| public final Number remainder originating from x % y | |
| DivisionResult | back to summary |
|---|---|
| private DivisionResult(Number quotient, Number remainder) | |
| of | back to summary |
|---|---|
| public static NumberSystem. | |