Package-level declarations

Types

Link copied to clipboard
class BigDecimal : BigNumber<BigDecimal> , CommonBigNumberOperations<BigDecimal> , NarrowingOperations<BigDecimal> , Comparable<Any>

Implementation of floating-point arbitrary precision arithmetic.

Link copied to clipboard
data class DecimalMode(val decimalPrecision: Long = 0, val roundingMode: RoundingMode = RoundingMode.NONE, val scale: Long = -1)

Decimal precision signifies how many digits will significand have. If decimal precision is 0 and RoundingMode is NONE infinite precision is used.

Link copied to clipboard

Created by Ugljesa Jovanovic ugljesa.jovanovic@ionspin.com on 23-Mar-2019

Functions

Link copied to clipboard
operator fun Byte.div(other: BigDecimal): BigDecimal
operator fun Double.div(other: BigDecimal): BigDecimal
operator fun Float.div(other: BigDecimal): BigDecimal
operator fun Int.div(other: BigDecimal): BigDecimal
operator fun Long.div(other: BigDecimal): BigDecimal
operator fun Short.div(other: BigDecimal): BigDecimal
Link copied to clipboard
operator fun Byte.minus(other: BigDecimal): BigDecimal
operator fun Double.minus(other: BigDecimal): BigDecimal
operator fun Float.minus(other: BigDecimal): BigDecimal
operator fun Int.minus(other: BigDecimal): BigDecimal
operator fun Long.minus(other: BigDecimal): BigDecimal
operator fun Short.minus(other: BigDecimal): BigDecimal
Link copied to clipboard
operator fun Byte.plus(other: BigDecimal): BigDecimal
operator fun Double.plus(other: BigDecimal): BigDecimal
operator fun Float.plus(other: BigDecimal): BigDecimal
operator fun Int.plus(other: BigDecimal): BigDecimal
operator fun Long.plus(other: BigDecimal): BigDecimal
operator fun Short.plus(other: BigDecimal): BigDecimal
Link copied to clipboard
operator fun Byte.rem(other: BigDecimal): BigDecimal
operator fun Double.rem(other: BigDecimal): BigDecimal
operator fun Float.rem(other: BigDecimal): BigDecimal
operator fun Int.rem(other: BigDecimal): BigDecimal
operator fun Long.rem(other: BigDecimal): BigDecimal
operator fun Short.rem(other: BigDecimal): BigDecimal
Link copied to clipboard
operator fun Byte.times(other: BigDecimal): BigDecimal
operator fun Double.times(other: BigDecimal): BigDecimal
operator fun Float.times(other: BigDecimal): BigDecimal
operator fun Int.times(other: BigDecimal): BigDecimal
operator fun Long.times(other: BigDecimal): BigDecimal
operator fun Short.times(other: BigDecimal): BigDecimal
Link copied to clipboard
fun Byte.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 12.toByte().toBigDecimal() produces 1.2E1 12.toByte().toBigDecimal(exponentModifier = 2) produces 1.2E3 (original exponent was 1 and modifier adds 2)

fun Double.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 1234.0.toBigDecimal() produces 1.234E3 1234.0.toBigDecimal(exponentModifier = 2) produces 1.234E5 (original exponent was 3 and modifier adds 2)

fun Float.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 1234F.toBigDecimal() produces 1.234E3 1234F.toBigDecimal(exponentModifier = 2) produces 1.234E5 (original exponent was 3 and modifier adds 2)

fun Int.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 1234.toBigDecimal() produces 1.234E3 1234.toBigDecimal(exponentModifier = 2) produces 1.234E5 (original exponent was 3 and modifier adds 2)

fun Long.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 1234L.toBigDecimal() produces 1.234E3 1234L.toBigDecimal(exponentModifier = 2) produces 1.234E5 (original exponent was 3 and modifier adds 2)

fun Short.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: 123.toShort().toBigDecimal() produces 1.23E2 123.toShort().toBigDecimal(exponentModifier = 2) produces 1.23E4 (original exponent was 2 and modifier adds 2)

fun String.toBigDecimal(exponentModifier: Long? = null, decimalMode: DecimalMode? = null): BigDecimal

Converts a number to big decimal, optionally modifies the exponent and provides decimal mode. Example: "1234".toBigDecimal() produces 1.234E3 "1234".toBigDecimal(exponentModifier = 2) produces 1.234E5 (original exponent was 3 and modifier adds 2)

Link copied to clipboard

Create BigDecimal from BigInteger significand and supplied exponent. Example: 12.toByte().toBigDecimalUsingSignificandAndExponent(2) produces 1.2E2

Create BigDecimal from BigInteger significand and supplied exponent. Example: 1234L.toBigDecimalUsingSignificandAndExponent(2) produces 1.234E2

Create BigDecimal from BigInteger significand and supplied exponent. Example: 123.toShort().toBigDecimalUsingSignificandAndExponent(2) produces 1.23E2

Link copied to clipboard

Created by Ugljesa Jovanovic ugljesa.jovanovic@ionspin.com on 24-Mar-2019