Crates.io | polynom |
lib.rs | polynom |
version | 0.1.1 |
source | src |
created_at | 2019-08-17 05:28:55.64851 |
updated_at | 2019-08-17 23:00:38.396142 |
description | A simple library for handling polynomials |
homepage | https://github.com/tindleaj/polynom-rs |
repository | https://github.com/tindleaj/polynom-rs |
max_upload_size | |
id | 157582 |
size | 15,324 |
Simple library for dealing with polynomials in Rust.
To view the generated documentation, run
cargo doc --open
To run the test suite,
cargo test
A new polynomial can be created from a vector of coefficients and an indeterminate as follows:
use polynom::polynomial::Polynomial;
let polynomial = Polynomial::new(vec![1f64, 2f64, 3f64], 'x');
assert_eq!(polynomial.as_string(), String::from("f(x) = 1 + 2x + 3x^2")
This was inspired by Ch.1, Section 4 of Jeremy Kun's A Programmer's Introduction to Mathematics. This library is a port of the polynomial.py
class Kun provides in the GitHub repo that accompanies the book.
This library is far from perfect, you probably shouldn't use it in production.