🧮 frac

Package Version Hex Docs

Work with fractions in Gleam!

import frac

pub fn main() {
  let result =
    frac.new(1, 2)
    |> frac.add(frac.new(1, 3))
    |> frac.to_lowest_terms

  let assert True = result == frac.new(5, 6)
}

To add this package to your project you can:

gleam add frac@1
Search Document