use-series
Install
[]
= "0.0.1"
Foundation
use-series provides a deliberately small exact progression surface. The crate currently exposes zero-based arithmetic and geometric nth-term helpers plus checked partial sums over signed i128 values. Overflow remains explicit through SeriesError rather than relying on panics or silently widening into floating-point behavior.
| Helper group | Primary items | Best fit |
|---|---|---|
| Arithmetic progressions | arithmetic_nth_term, arithmetic_sum |
Linear sequences, step-based schedules, and exact partial sums |
| Geometric progressions | geometric_nth_term, geometric_sum |
Exponential growth or decay with exact signed ratios |
When to use directly
Choose use-series directly when sequence and series helpers are the only surface you need and you want to keep that concern narrower than the full facade crate.
| Scenario | Use use-series directly? |
Why |
|---|---|---|
| You only need arithmetic or geometric progression helpers | Yes | The crate stays smaller than the facade and keeps progression arithmetic explicit |
| You want exact signed partial sums without floating-point rounding | Yes | The current surface is checked and stays in i128 |
| You also need combinatorics, geometry, or other math domains | Usually no | use-math can unify the concrete surfaces behind features |
Scope
- The current surface is intentionally small and concrete.
- Progression helpers stay function-oriented instead of introducing wrapper types without extra invariants.
- Catalan-family sequences and calculus-specific analysis helpers belong in adjacent focused crates.
Examples
Arithmetic progressions
use ;
assert_eq!;
assert_eq!;
# Ok::
Geometric progressions
use ;
assert_eq!;
assert_eq!;
# Ok::
Status
use-series is a concrete pre-1.0 crate in the RustUse docs surface. The API remains intentionally small while broader sequence and analysis crates continue to grow around it.