All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jsMain.js.core.BigInt.kt Maven / Gradle / Ivy

package js.core

sealed external interface BigInt

external fun BigInt(
    value: Number,
): BigInt

external fun BigInt(
    value: String,
): BigInt

inline val Number.n: BigInt
    get() = BigInt(this)

inline val String.n: BigInt
    get() = BigInt(this)

inline operator fun BigInt.unaryMinus(): BigInt =
    (-unsafeCast()).unsafeCast()

inline operator fun BigInt.plus(other: BigInt): BigInt =
    (unsafeCast() + other.unsafeCast()).unsafeCast()

inline operator fun BigInt.minus(other: BigInt): BigInt =
    (unsafeCast() - other.unsafeCast()).unsafeCast()

inline operator fun BigInt.times(other: BigInt): BigInt =
    (unsafeCast() * other.unsafeCast()).unsafeCast()

inline operator fun BigInt.div(other: BigInt): BigInt =
    (unsafeCast() / other.unsafeCast()).unsafeCast()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy