1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-FileCopyrightText: 2026 John Moxley
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Reusable width-matched integer algorithms.
//!
//! The integer layer's algorithm bucket, organised by function so the
//! layout mirrors the decimal `crate::algos::<fn>/` tree: each dispatched
//! function's algorithm/kernel fns live in `int/algos/<function>/`, and the
//! per-width *choice* between them lives in `crate::int::policy::<function>`.
//! The call graph only ever points DOWN — a type method delegates to its
//! `policy::<fn>::dispatch`, the dispatch selects an algorithm fn, and the
//! algorithm computes via the kernels here (never a method back on its own
//! type).
//!
//! Function families:
//!
//! - [`mul`] — schoolbook (+ fixed/single-word/truncated specialisations)
//! and Karatsuba multiply kernels.
//! - [`sqr`] — the half-product squaring algorithm and its low-`N` kernel.
//! - [`cube`] — sqr-then-multiply cubing.
//! - [`pow`] — binary square-and-multiply exponentiation.
//! - [`div`] — the division engines (`div_rem` const fast path, Knuth,
//! Burnikel–Ziegler, the Möller–Granlund reciprocal estimators) and the
//! const-`N` fast-arm divmod wrappers.
//! - [`isqrt`] — Newton integer square root + its const-`N` fast-arm wrapper.
//! - [`icbrt`] — Newton integer cube root.
//! - [`sum_sq`] — `a^2 + b^2`, the sqrt-free magnitude core hypot shares.
//!
//! Shared low-level limb PRIMITIVES that are not a single function's
//! headline algorithm — comparison, equality, bit-length, ripple add/sub,
//! shifts, single-limb fit test, signed compare — stay in the shared
//! [`support::limbs`] bucket, since they are composed by several families (the
//! divide engines, Karatsuba, the roots, and the type layer itself).
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub