lux/math/ratio

Rational arithmetic.

Types

Ratio

(type: Ratio
  {#numerator lux;Nat
   #denominator lux;Nat})

Macros

ratio

## Rational literals.
(ratio numerator denominator)

## The denominator can be omitted if it's 1.
(ratio numerator)

Structs

Codec<Text,Ratio>

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

Eq<Ratio>

(lux/control/eq;Eq Ratio)

Number<Ratio>

(lux/control/number;Number Ratio)

Ord<Ratio>

(lux/control/ord;Ord Ratio)

Values

(q.% param input)

(-> Ratio Ratio Ratio)

(q.* param input)

(-> Ratio Ratio Ratio)

(q.+ param input)

(-> Ratio Ratio Ratio)

(q.- param input)

(-> Ratio Ratio Ratio)

(q./ param input)

(-> Ratio Ratio Ratio)

(q.< param input)

(-> Ratio Ratio lux;Bool)

(q.<= param input)

(-> Ratio Ratio lux;Bool)

(q.= param input)

(-> Ratio Ratio lux;Bool)

(q.> param input)

(-> Ratio Ratio lux;Bool)

(q.>= param input)

(-> Ratio Ratio lux;Bool)

(q.max left right)

(-> Ratio Ratio Ratio)

(q.min left right)

(-> Ratio Ratio Ratio)