themis/number
Types
pub type ComparisonError {
NaNValue
}
Constructors
-
NaNValue
Functions
pub fn add(value1 val1: Number, value2 val2: Number) -> Number
Add two numbers.
Any NaN
input value will always return NaN
.
PosInf
+ NegInf
= NaN
pub fn compare(
compare val1: Number,
to val2: Number,
) -> Result(Order, ComparisonError)
Compare two numbers (see gleam_stdlib/order) Will return an error if either value is NaN
pub fn decimal(value value: Float) -> Number
Creates a Number representing a decimal value.
pub fn integer(value value: Int) -> Number
Creates a Number representing an integer value.
pub fn negative_infinity() -> Number
Creates a Number representing negative infinity.
pub fn positive_infinity() -> Number
Creates a Number representing positive infinity.