Skip to main content

Crate use_series

Crate use_series 

Source
Expand description

§use-series

Small arithmetic and geometric progression helpers for `RustUse`.
Exact checked nth-term and partial-sum helpers for common progression workflows.

Rust 1.95.0+ Edition 2024 Series progressions License MIT or Apache-2.0

§Install

[dependencies]
use-series = "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.

Arithmetic progression helpers
arithmetic_nth_term and arithmetic_sum cover exact linear progressions with signed steps.
Geometric progression helpers
geometric_nth_term and geometric_sum cover exact signed-ratio progressions.
Explicit overflow
SeriesError reports the operation that overflowed instead of hiding arithmetic limits.
Helper groupPrimary itemsBest fit
Arithmetic progressionsarithmetic_nth_term, arithmetic_sumLinear sequences, step-based schedules, and exact partial sums
Geometric progressionsgeometric_nth_term, geometric_sumExponential 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.

ScenarioUse use-series directly?Why
You only need arithmetic or geometric progression helpersYesThe crate stays smaller than the facade and keeps progression arithmetic explicit
You want exact signed partial sums without floating-point roundingYesThe current surface is checked and stays in i128
You also need combinatorics, geometry, or other math domainsUsually nouse-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 use_series::{arithmetic_nth_term, arithmetic_sum};

assert_eq!(arithmetic_nth_term(3, 2, 4)?, 11);
assert_eq!(arithmetic_sum(3, 2, 5)?, 35);

§Geometric progressions

use use_series::{geometric_nth_term, geometric_sum};

assert_eq!(geometric_nth_term(2, 3, 4)?, 162);
assert_eq!(geometric_sum(2, 3, 4)?, 80);

§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. Series utilities for RustUse.

Re-exports§

pub use error::SeriesError;
pub use progression::arithmetic_nth_term;
pub use progression::arithmetic_sum;
pub use progression::geometric_nth_term;
pub use progression::geometric_sum;

Modules§

error
prelude
Common ergonomic imports for use-series.
progression