Companion

object Companion

Properties

Link copied to clipboard

The pattern recognizing textual representations of Integers. See Integer.of.

Link copied to clipboard

The pattern recognizing textual representations of Reals. See Real.of.

Functions

Link copied to clipboard
fun of(integer: Byte): Integer
fun of(integer: Int): Integer
fun of(integer: Long): Integer
fun of(integer: Short): Integer
fun of(integer: BigInteger): Integer

Creates an Integer out of integer. See Integer.of.

fun of(decimal: Double): Real
fun of(decimal: Float): Real
fun of(decimal: BigDecimal): Real

Creates a Real out of decimal. See Real.of.

fun of(value: Number): Numeric

Creates a Numeric out of the given value, picking Integer or Real depending on its Kotlin type (Double/Float become Real, integral types become Integer; any other Number is converted via its Any.toString representation, then parsed like of would).

fun of(number: String): Numeric

Parses number into a Numeric, trying Integer.of first and falling back to Real.of if that fails.