lux/data/number

Implementations of common structures for Lux's primitive number types.

Macros

bin

## Given syntax for a binary number, generates a Nat.
(bin "11001001")

hex

## Given syntax for a hexadecimal number, generates a Nat.
(hex "deadBEEF")

oct

## Given syntax for an octal number, generates a Nat.
(oct "615243")

Structs

Add@Monoid<Frac>

(lux/control/monoid;Monoid lux;Frac)

Add@Monoid<Int>

(lux/control/monoid;Monoid lux;Int)

Add@Monoid<Nat>

(lux/control/monoid;Monoid lux;Nat)

Add@Monoid<Real>

(lux/control/monoid;Monoid lux;Real)

Binary@Codec<Text,Nat>

(lux/control/codec;Codec lux;Text lux;Nat)

Bounded<Frac>

(lux/control/bounded;Bounded lux;Frac)

Bounded<Int>

(lux/control/bounded;Bounded lux;Int)

Bounded<Nat>

(lux/control/bounded;Bounded lux;Nat)

Bounded<Real>

(lux/control/bounded;Bounded lux;Real)

Codec<Text,Frac>

(lux/control/codec;Codec lux;Text lux;Frac)

Codec<Text,Int>

(lux/control/codec;Codec lux;Text lux;Int)

Codec<Text,Nat>

(lux/control/codec;Codec lux;Text lux;Nat)

Codec<Text,Real>

(lux/control/codec;Codec lux;Text lux;Real)

Enum<Int>

(lux/control/enum;Enum lux;Int)

Enum<Nat>

(lux/control/enum;Enum lux;Nat)

Eq<Frac>

(lux/control/eq;Eq lux;Frac)

Eq<Int>

(lux/control/eq;Eq lux;Int)

Eq<Nat>

(lux/control/eq;Eq lux;Nat)

Eq<Real>

(lux/control/eq;Eq lux;Real)

Hash<Int>

(lux/control/hash;Hash lux;Int)

Hash<Nat>

(lux/control/hash;Hash lux;Nat)

Hash<Real>

(lux/control/hash;Hash lux;Real)

Hex@Codec<Text,Nat>

(lux/control/codec;Codec lux;Text lux;Nat)

Max@Monoid<Frac>

(lux/control/monoid;Monoid lux;Frac)

Max@Monoid<Int>

(lux/control/monoid;Monoid lux;Int)

Max@Monoid<Nat>

(lux/control/monoid;Monoid lux;Nat)

Max@Monoid<Real>

(lux/control/monoid;Monoid lux;Real)

Min@Monoid<Frac>

(lux/control/monoid;Monoid lux;Frac)

Min@Monoid<Int>

(lux/control/monoid;Monoid lux;Int)

Min@Monoid<Nat>

(lux/control/monoid;Monoid lux;Nat)

Min@Monoid<Real>

(lux/control/monoid;Monoid lux;Real)

Mul@Monoid<Frac>

(lux/control/monoid;Monoid lux;Frac)

Mul@Monoid<Int>

(lux/control/monoid;Monoid lux;Int)

Mul@Monoid<Nat>

(lux/control/monoid;Monoid lux;Nat)

Mul@Monoid<Real>

(lux/control/monoid;Monoid lux;Real)

Number<Frac>

(lux/control/number;Number lux;Frac)

Number<Int>

(lux/control/number;Number lux;Int)

Number<Nat>

(lux/control/number;Number lux;Nat)

Number<Real>

(lux/control/number;Number lux;Real)

Octal@Codec<Text,Nat>

(lux/control/codec;Codec lux;Text lux;Nat)

Ord<Frac>

(lux/control/ord;Ord lux;Frac)

Ord<Int>

(lux/control/ord;Ord lux;Int)

Ord<Nat>

(lux/control/ord;Ord lux;Nat)

Ord<Real>

(lux/control/ord;Ord lux;Real)

Values

+inf

Positive infinity.

lux;Real

-inf

Negative infinity.

lux;Real

nan

Not-a-number.

lux;Real

(nan? number)

Tests whether a real is actually not-a-number.

(-> lux;Real lux;Bool)