Small ratio type library for Idris2 | GitHub Mirror: https://github.com/kiana-S/idris2-ratio
Find a file
2024-06-06 20:51:11 -04:00
src/Data Use assert_smaller instead of assert_total 2024-06-06 20:51:11 -04:00
.gitignore Initial commit 2022-09-02 21:59:06 -04:00
LICENSE Bump copyright year 2024-06-06 20:47:45 -04:00
ratio.ipkg Create Data.Ratio 2022-09-03 19:39:56 -04:00
README.md Create README 2022-09-04 16:39:55 -04:00

idris2-ratio

A small library for arbitrary-precision ratio types.

The main type exported by this library is Data.Ratio.Rational, which is a number type stored as the ratio between two integers. The ratio is always stored in reduced form to save memory space, but this comes at the cost of worst-case O(n) arithmetic.

The specific integer type used for the ratio can be set by using Data.Ratio.Ratio, which takes a type parameter a. Most operations require Integral a.