MathContext
Configuration class for BigDecimal (immutable).
Static Member Summary
| Static Public Members | ||
| public static get |
128-bit floating point. |
|
| public static get |
256-bit floating point. |
|
| public static get |
DECIMAL32: MathContext: * 32-bit floating point. |
|
| public static get |
DECIMAL64: MathContext: * 64-bit floating point. |
|
| public static get |
UNLIMITED: MathContext: * No decimal point limit. |
|
Static Method Summary
| Static Public Methods | ||
| public static |
create(precision_or_name: string | number | MathContext, roundingMode: RoundingModeEntity): MathContext Create BigDecimal configuration. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(precision_or_name: string | number | MathContext, roundingMode: RoundingModeEntity) Create BigDecimal configuration. |
|
Member Summary
| Private Members | ||
| private |
The precision of this BigDecimal. |
|
| private |
Method of rounding. |
|
Method Summary
| Public Methods | ||
| public |
Decrease in the precision of x. |
|
| public |
equals(x: MathContext): boolean Equals. |
|
| public |
The precision of this BigDecimal. |
|
| public |
Method of rounding. |
|
| public |
Increase in the precision of x. |
|
| public |
Convert to string. |
|
Static Public Members
public static get DECIMAL128: MathContext: * source
128-bit floating point.
- Significand precision: 112 bits
- Equivalent of the C language long double.
public static get DECIMAL256: MathContext source
256-bit floating point.
- Significand precision: 237 bits
public static get DECIMAL32: MathContext: * source
32-bit floating point.
- Significand precision: 23 bits
- Equivalent of the C language float.
public static get DECIMAL64: MathContext: * source
64-bit floating point.
- Significand precision: 52 bits
- Equivalent of the C language double.
public static get UNLIMITED: MathContext: * source
No decimal point limit. However, an error occurs in the case of cyclic fraction in division.
Static Public Methods
public static create(precision_or_name: string | number | MathContext, roundingMode: RoundingModeEntity): MathContext source
Create BigDecimal configuration.
Params:
| Name | Type | Attribute | Description |
| precision_or_name | string | number | MathContext | Precision. Or String output by MathContext.toString. |
|
| roundingMode | RoundingModeEntity |
|
RoundingMode. |
Public Constructors
public constructor(precision_or_name: string | number | MathContext, roundingMode: RoundingModeEntity) source
Create BigDecimal configuration.
Params:
| Name | Type | Attribute | Description |
| precision_or_name | string | number | MathContext | Precision. Or String output by MathContext.toString. |
|
| roundingMode | RoundingModeEntity |
|
RoundingMode. |
Private Members
Public Methods
public decreasePrecision(x: number): MathContext source
Decrease in the precision of x.
- If the setting has no precision limit, do not change.
Params:
| Name | Type | Attribute | Description |
| x | number |
|
public equals(x: MathContext): boolean source
Equals.
Params:
| Name | Type | Attribute | Description |
| x | MathContext | Number to compare. |
public increasePrecision(x: number): MathContext source
Increase in the precision of x.
- If the setting has no precision limit, do not change.
Params:
| Name | Type | Attribute | Description |
| x | number |
|
