/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { RoundingMode } from "../RoundingMode"; import type { Object } from "../../lang/Object"; import type { String } from "../../lang/String"; import type { Serializable } from "../../io/Serializable"; /** * Immutable objects which encapsulate the context settings which * describe certain rules for numerical operators, such as those * implemented by the {@link BigDecimal} class. * *

The base-independent settings are: *

    *
  1. {@code precision}: * the number of digits to be used for an operation; results are * rounded to this precision * *
  2. {@code roundingMode}: * a {@link RoundingMode} object which specifies the algorithm to be * used for rounding. *
* @see BigDecimal * @see RoundingMode * @author Mike Cowlishaw * @author Joseph D. Darcy * @since 1.5 */ export type MathContext = Object & Serializable & { /** * Returns the {@code precision} setting. * This value is always non-negative. * @return an {@code int} which is the value of the {@code precision} setting */ getPrecision(): number; /** * Returns the roundingMode setting. * This will be one of * {@link RoundingMode#CEILING}, * {@link RoundingMode#DOWN}, * {@link RoundingMode#FLOOR}, * {@link RoundingMode#HALF_DOWN}, * {@link RoundingMode#HALF_EVEN}, * {@link RoundingMode#HALF_UP}, * {@link RoundingMode#UNNECESSARY}, or * {@link RoundingMode#UP}. * @return a {@code RoundingMode} object which is the value of the {@code roundingMode} setting */ getRoundingMode(): RoundingMode; /** * Compares this {@code MathContext} with the specified * {@code Object} for equality. * @param x {@code Object} to which this {@code MathContext} is to be compared. * @return {@code true} if and only if the specified {@code Object} is a {@code MathContext} object which has exactly the same settings as this object */ equals(x: unknown): boolean; /** * Returns the hash code for this {@code MathContext}. * @return hash code for this {@code MathContext} */ hashCode(): number; /** * Returns the string representation of this {@code MathContext}. * The {@code String} returned represents the settings of the * {@code MathContext} object as two space-delimited words * (separated by a single space character, '\u0020', * and with no leading or trailing white space), as follows: *
    *
  1. * The string {@code "precision="}, immediately followed * by the value of the precision setting as a numeric string as if * generated by the {@link Integer#toString(int) Integer.toString} * method. * *
  2. * The string {@code "roundingMode="}, immediately * followed by the value of the {@code roundingMode} setting as a * word. This word will be the same as the name of the * corresponding public constant in the {@link RoundingMode} * enum. *
*

* For example: *

     *  precision=9 roundingMode=HALF_UP
     *  
* * Additional words may be appended to the result of * {@code toString} in the future if more properties are added to * this class. * @return a {@code String} representing the context settings */ toString(): string; /** * A {@code MathContext} object whose settings have the values * required for unlimited precision arithmetic. * The values of the settings are: * * precision=0 roundingMode=HALF_UP * */ UNLIMITED: MathContext; /** * A {@code MathContext} object with a precision setting * matching the IEEE 754R Decimal32 format, 7 digits, and a * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the * IEEE 754R default. */ DECIMAL32: MathContext; /** * A {@code MathContext} object with a precision setting * matching the IEEE 754R Decimal64 format, 16 digits, and a * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the * IEEE 754R default. */ DECIMAL64: MathContext; /** * A {@code MathContext} object with a precision setting * matching the IEEE 754R Decimal128 format, 34 digits, and a * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the * IEEE 754R default. */ DECIMAL128: MathContext; };