of

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

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


fun of(integer: BigInteger): Integer
fun of(integer: Int): Integer
fun of(integer: Long): Integer
fun of(integer: Short): Integer
fun of(integer: Byte): Integer

Creates an Integer out of integer. See Integer.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.

Throws

if number can be parsed as neither an Integer nor a Real