Skip to main content

Crate ni_number

Crate ni_number 

Source
Expand description

§ni-number

High-precision computation of the Ni constant (η_ν) — the quantum energy scattering constant.

§Definition

The Ni constant is defined by the series:

η_ν = Σ (n=1..∞)  πⁿ / (n! · 2^(n²))

Value: 1.88937666040491913115597775087642096081019761538215…

§Backends

FeatureBackendRequiresPrecision
backend-dashupure Rustnothing (default)arbitrary
backend-rugGNU MPFRMSYS2 on Windowsarbitrary

§Quick start

# Cargo.toml — pure Rust, works on every platform
[dependencies]
ni-number = "1.0"

# Maximum performance via GNU MPFR
ni-number = { version = "1.0", features = ["backend-rug"] }
use ni_number::{NI_F64, ni_number_digits};

println!("η_ν ≈ {}", NI_F64);                // fast — pre-computed constant
println!("η_ν = {}", ni_number_digits(100));  // 100 decimal digits

Re-exports§

pub use compute::digits_to_bits as bits_for_digits;
pub use constants::NI_50_DIGITS;
pub use constants::NI_F32;
pub use constants::NI_F64;

Modules§

backend
Backend trait definitions for the Ni constant computation engine.
cache
Thread-safe cache for computed Ni constant values.
compute
Core algorithm for computing the Ni constant (η_ν).
constants
Pre-computed constants and formatting utilities for the Ni number.
series
Lazy iterator over the terms of the η_ν series.

Functions§

clear_cache
Clear the internal cache and free its memory.
ni_number
Compute η_ν to precision_bits of internal bit precision.
ni_number_digits
Compute η_ν and return a decimal string with decimal_digits digits after the decimal point.
ni_series
Return a lazy iterator over the individual series terms.