Skip to content
mine-tech-oficialPublic

About

A Gleam library for working with polynomials

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

poly

Package Version Hex Docs

A library for working with polynomials. Provides an abstract module, at poly, for generic coefficients, and specific modules for integers and floats, at poly/int and poly/float, respectively.

Special thanks to yoshi for their beautiful docs at iv that were used as heavy inspiration.

gleam add polynomial@1
import poly

pub fn main() {
  let ops = poly.Operations(
    zero: 0,
    add: int.add,
    subtract: int.subtract,
    multiply: int.multiply,
    divide: int.divide
  )

  let a = poly.from_list([1, 2, 3])
  let b = poly.from_list([4, 5, 6])

  // Prints out [4, 13, 28, 27, 18]
  echo poly.coefficients(poly.multiply(a, b, with: ops))
}

Further documentation can be found at https://hexdocs.pm/poly.

Development

gleam run   # Run the project
gleam test  # Run the tests

About

A Gleam library for working with polynomials

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages