Table of contents
- Rational (type alias)
- one (constant)
- ord (constant)
- setoid (constant)
- zero (constant)
- add (function)
- ceil (function)
- div (function)
- floor (function)
- fromInteger (function)
- isZero (function)
- mul (function)
- negate (function)
- reduce (function)
- round (function)
- show (function)
- sign (function)
- sub (function)
- trunc (function)
Rational (type alias)
Signature
export type Rational = [Integer, Natural]
one (constant)
Signature
export const one: Rational = ...
ord (constant)
Signature
export const ord: Ord<Rational> = ...
setoid (constant)
Signature
export const setoid: Setoid<Rational> = ...
zero (constant)
Signature
export const zero: Rational = ...
add (function)
Signature
export function add([nx, dx]: Rational, [ny, dy]: Rational): Rational { ... }
ceil (function)
Signature
export function ceil(x: Rational): Integer { ... }
div (function)
Signature
export function div(x: Rational, y: NonZeroRational): Rational { ... }
floor (function)
Signature
export function floor(x: Rational): Integer { ... }
fromInteger (function)
Signature
export function fromInteger(x: Integer): Rational { ... }
isZero (function)
Signature
export function isZero(x: Rational): boolean { ... }
mul (function)
Signature
export function mul(x: Rational, y: Rational): Rational { ... }
negate (function)
Signature
export function negate(x: Rational): Rational { ... }
reduce (function)
Signature
export function reduce(n: Integer, d: Natural): Rational { ... }
round (function)
Signature
export function round(x: Rational): Integer { ... }
show (function)
Signature
export const show = (x: Rational): string => ...
sign (function)
Signature
export function sign(x: Rational): -1 | 0 | 1 { ... }
sub (function)
Signature
export function sub(x: Rational, y: Rational): Rational { ... }
trunc (function)
Signature
export function trunc(x: Rational): Integer { ... }