algebraics-0.1.2 is not a library.
Algebraic Numbers Library
Use when you need exact arithmetic, speed is not critical, and rational numbers aren't good enough.
Example:
use *;
use RealAlgebraicNumber as Number;
let two = from;
// 2 is a rational number
assert!;
// 1/2 is the reciprocal of 2
let one_half = two.recip;
// 1/2 is also a rational number
assert!;
// 2^(1/4)
let root = .pow;
// we can use all the standard comparison operators
assert!;
assert!;
assert!;
// we can use all of add, subtract, multiply, divide, and remainder
let sum = &root + &root;
let difference = &root - from;
let product = &root * &one_half;
let quotient = &one_half / &root;
let remainder = &root % &one_half;
// root is not a rational number
assert!;
// the calculations are always exact
assert_eq!;
// lets compute 30 decimal places of root
let scale = from.pow;
let scaled = &root * scale;
let digits = scaled.into_integer_trunc;
assert_eq!;
// get the minimal polynomial
let other_number = root + two.pow;
assert_eq!;
// works with really big numbers
let really_big = from.pow + from;
assert_eq!
Python support
Using algebraics from Python:
= 2 **
assert * == 2
Using algebraics in your own Rust project:
[]
= "0.1.2"
= ["python"]
Developing algebraics: