KBigDecimal

Interface for arbitrary-precision decimal arithmetic. Provides operations for mathematical calculations with decimal numbers of unlimited precision.

Inheritors

Functions

Link copied to clipboard
abstract fun abs(): KBigDecimal

Returns the absolute value of this KBigDecimal.

Link copied to clipboard
abstract fun add(other: KBigDecimal): KBigDecimal

Returns a KBigDecimal that is the sum of this and the specified value.

Link copied to clipboard
abstract operator fun compareTo(other: KBigDecimal): Int
Link copied to clipboard
operator fun KBigDecimal.div(other: KBigDecimal): KBigDecimal

Division operator for KBigDecimal with default scale and rounding.

Link copied to clipboard
abstract fun divide(other: KBigDecimal, scale: Int): KBigDecimal
abstract fun divide(other: KBigDecimal, scale: Int, mode: Int): KBigDecimal

Returns a KBigDecimal that is the quotient of this divided by the specified value.

Link copied to clipboard
open fun isNegative(): Boolean

Checks if this KBigDecimal is negative (less than zero).

Link copied to clipboard
open fun isPositive(): Boolean

Checks if this KBigDecimal is positive (greater than zero).

Link copied to clipboard
open fun isZero(): Boolean

Checks if this KBigDecimal is equal to zero.

Link copied to clipboard

Returns the maximum of this KBigDecimal and the specified value.

Link copied to clipboard

Returns the minimum of this KBigDecimal and the specified value.

Link copied to clipboard

Subtraction operator for KBigDecimal.

Link copied to clipboard
abstract fun multiply(other: KBigDecimal): KBigDecimal

Returns a KBigDecimal that is the product of this and the specified value.

Link copied to clipboard
open fun negate(): KBigDecimal

Returns the negation of this KBigDecimal.

Link copied to clipboard
operator fun KBigDecimal.plus(other: KBigDecimal): KBigDecimal

Addition operator for KBigDecimal.

Link copied to clipboard
fun KBigDecimal.pow(exponent: Int): KBigDecimal

Calculates this KBigDecimal raised to the power of the specified integer exponent.

Link copied to clipboard
open fun precision(): Int

Returns the precision of this KBigDecimal (total number of significant digits).

Link copied to clipboard
open fun scale(): Int

Returns the scale of this KBigDecimal (number of digits to the right of the decimal point).

Link copied to clipboard
abstract fun setScale(scale: Int, roundingMode: Int): KBigDecimal

Returns a KBigDecimal with the specified scale and rounding mode.

Link copied to clipboard
abstract fun signum(): Int

Returns the signum function of this KBigDecimal.

Link copied to clipboard
abstract fun subtract(other: KBigDecimal): KBigDecimal

Returns a KBigDecimal that is the difference of this and the specified value.

Link copied to clipboard

Multiplication operator for KBigDecimal.

Link copied to clipboard
abstract fun toBigInteger(): KBigInteger

Converts this KBigDecimal to a KBigInteger by discarding the fractional part.

Link copied to clipboard
abstract override fun toString(): String

Returns the string representation of this KBigDecimal.

Link copied to clipboard

Unary minus operator for KBigDecimal.

Link copied to clipboard

Unary plus operator for KBigDecimal (identity operation).