pub fn solve_pell_negative(d: Integer) -> Option<(Integer, Integer)>Expand description
Calculate fundamental solution of x^2 - d*y^2 = -1
If x^2 - d*y^2 = -1 has nontrivial solution, returns its fundamental solution.
Otherwise returns None.
use rug::Integer;
let v = pell_equation::solve_pell_negative(Integer::from(2));
assert_eq!(v, Some((Integer::from(1), Integer::from(1))));
let w = pell_equation::solve_pell_negative(Integer::from(3));
assert_eq!(w, None);