Expand description
Solve Pell’s equation
use rug::Integer;
let v = pell_equation::solve_pell(Integer::from(2));
assert_eq!(v, pell_equation::Solution::Negative(Integer::from(1), Integer::from(1)));
let w = pell_equation::solve_pell(Integer::from(3));
assert_eq!(w, pell_equation::Solution::Positive(Integer::from(2), Integer::from(1)));Enums§
- Solution
- Fundamental solution of
x^2 - d*y^2 = ±1
Functions§
- continued_
fraction_ of_ sqrt - Calculate continued fraction of √d
- solve_
pell - Calculate fundamental solution of
x^2 - d*y^2 = ±1 - solve_
pell_ negative - Calculate fundamental solution of
x^2 - d*y^2 = -1 - solve_
pell_ positive - Calculate fundamental solution of
x^2 - d*y^2 = 1