This library provides Rational & TrigoFloat modules which export the following funcitons.
Rational module
new-int -> int -> Rational.tinverse-Rational.t -> Rational.tadd-Rational.t -> Rational.t -> Rational.tsub-Rational.t -> Rational.t -> Rational.tlt-Rational.t -> Rational.t -> boollte-Rational.t -> Rational.t -> boolgte-Rational.t -> Rational.t -> boolgt-Rational.t -> Rational.t -> boolmul-Rational.t -> Rational.t -> Rational.tdiv-Rational.t -> Rational.t -> Rational.tmodulo-Rational.t -> Rational.t -> Rational.tresolve-Rational.t -> nat -> int
TrigoRational module
sinus-Rational.t * nat -> Rational.tcosinus-Rational.t * nat -> Rational.t
The rational numbers are represented by a pair (p, q) where n = p / q. All operations are applied in order to keep the number as a product and division of rationals.
Based on rational numbers representation, this library introduces an implementation of trigonometric functions (cosinus, sinus). The implementation of sinus is based on Chebychev polynomials interpolation.
A makefile is provided to launch tests.
make test