#factorial #termial

factorion-math

The math (factorials and related functions) used by factorion

2 stable releases

Uses new Rust 2024

1.0.1 Oct 18, 2025
1.0.0 Jul 27, 2025

#2296 in Math

Download history 102/week @ 2025-07-23 12/week @ 2025-07-30 2/week @ 2025-08-20 2/week @ 2025-08-27 11/week @ 2025-09-03 4/week @ 2025-09-10 1/week @ 2025-09-24 24/week @ 2025-10-01 1/week @ 2025-10-08 145/week @ 2025-10-15 34/week @ 2025-10-22

204 downloads per month
Used in 3 crates (via factorion-lib)

MIT and LGPL-3.0+

140KB
1.5K SLoC

Factorion Math

The math functions used by factorion. (Factorials and related functions) All functions that take [Integer]s, but internally use [Float]s, not only have a float alternative, but also take in a precision.

This crate uses [rug] in its interface. It is re-exported for convenience.

Features

  • k-factorials in exact, float, approximate, approximate digits
  • termials in exact, float, approximate, approximate digits
  • k-termials in exact, approximate, approximate digits
  • subfactorials in exact, approximate, approximate digits

Calculations are split in areas:

  • exact: integer calculation (accuracy)
  • float: float calculation (decimals)
  • approximate: approximation of integer calculation using float as a * 10^b (large numbers)
  • approximate digits: approximation of integer calculation using float as 10^b (extremely large numbers)

Formulas and their derivations are available in MATH.md

Dependencies

~21MB
~492K SLoC