Skip to main content

Crate oxinum_int

Crate oxinum_int 

Source
Expand description

Arbitrary-precision integer arithmetic for the OxiNum ecosystem.

Provides BigInt and BigUint type aliases over dashu-int’s IBig/UBig, plus number-theory functions: factorial, fibonacci, binomial coefficients, modular exponentiation, primality testing, and extended GCD.

Modules§

native
Native arbitrary-precision integer types implemented in pure Rust.

Structs§

IBig
An signed arbitrary precision integer.
UBig
An unsigned arbitrary precision integer.

Enums§

OxiNumError
Errors from OxiNum operations.
Sign
An enum representing the sign of a number

Traits§

Gcd
Compute the greatest common divisor.

Functions§

binomial
Computes the binomial coefficient C(n, k) = n! / (k! * (n-k)!).
extended_gcd
Computes the extended GCD of a and b, returning (gcd, x, y) such that a * x + b * y = gcd.
factorial
Computes n! (factorial of n).
fibonacci
Computes the n-th Fibonacci number using the fast-doubling method.
ibig_abs
Returns the absolute value of the IBig.
ibig_from_radix
Parse an IBig from src in the given radix (2..=36).
ibig_is_one
Returns true if the IBig is one.
ibig_is_zero
Returns true if the IBig is zero.
ibig_signum
Returns the sign of the IBig.
ibig_to_radix
Format an IBig as a string in the given radix (2..=36).
is_prime
Tests whether n is (probably) prime using the Miller-Rabin test.
lucas
Computes the Lucas number L(n) where L(0) = 2, L(1) = 1.
mod_pow
Computes (base^exp) mod modulus using binary (right-to-left) exponentiation.
next_prime
Returns the smallest prime greater than n.
ubig_from_radix
Parse a UBig from src in the given radix (2..=36).
ubig_is_one
Returns true if the UBig is one.
ubig_is_zero
Returns true if the UBig is zero.
ubig_to_radix
Format a UBig as a string in the given radix (2..=36).

Type Aliases§

BigInt
Type alias: BigInt is dashu_int::IBig.
BigUint
Type alias: BigUint is dashu_int::UBig.
OxiNumResult
Convenience alias for Result<T, OxiNumError>.