Files
mp-units/test
Chip Hogg d56ffc08b8 Add utilities to make Strong Lucas tests easier
The Strong Lucas test coming in the next PR will already be complicated
enough.  It'll be convenient, and less distracting, if we already have
functions for certain operations we'll need.

One thing we'll need to do is detect inputs that are perfect squares.
Fortunately, this is pretty easy to do robustly and quickly, with
Newton's method.  We _don't_ want to use `std::sqrt`, because that takes
us into the floating point domain for no good reason, which could give
us wrong answers for larger integers.

The other thing we need is Jacobi symbols.  These are a lot more
obscure, but thankfully, still resonably straightforward to compute.
The Wikipedia page (https://en.wikipedia.org/wiki/Jacobi_symbol) has a
good explanation, and in particular, good instructions for computing
values.

With these utilities in place, the Strong Lucas code should be easier to
review.
2024-11-14 20:14:20 -05:00
..