//! Associated constants for [`LehmerStep`].

use super::LehmerStep;

impl LehmerStep {
    /// Lehmer GCD phase-transition threshold (`2^32`).
    ///
    /// When the smaller remainder `b >= LEHMER_LIMIT`, the Lehmer invariant
    /// guarantees cofactors <= 2^31 and quotients <= 2^31, so all matrix
    /// arithmetic fits in u64. Below this threshold, cofactors may exceed
    /// u64 and a u128 fallback is required.
    pub const LEHMER_LIMIT: u64 = 1u64 << 32;
}

#[cfg(test)]
mod ai_tests {
    use super::*;

    /// LEHMER_LIMIT is exactly 2^32.
    #[test]
    fn lehmer_limit_value() {
        assert_eq!(LehmerStep::LEHMER_LIMIT, 1 << 32);
    }
}
