decimal-scaled 0.2.3

Const-generic base-10 fixed-point decimals (D9/D18/D38/D76/D153/D307) with integer-only transcendentals correctly rounded to within 0.5 ULP — exact at the type's last representable place. Deterministic across every platform; no_std-friendly.
Documentation
//! Scale-changing operations for every decimal width.
//!
//! Each `Dxx<SCALE>` carries its scale in the type. Converting between
//! two scales — for instance accumulating cents (`D38<2>`) into a
//! picometre-precision running total (`D38<12>`) — requires an explicit
//! rescale.
//!
//! Two surfaces, emitted on every width:
//!
//! - `rescale::<TARGET>()` — a `const fn` shorthand that uses the
//!   crate-default rounding mode (`HalfToEven` unless overridden by a
//!   `rounding-*` Cargo feature). Suitable for the overwhelming
//!   majority of cases.
//! - `rescale_with::<TARGET>(mode)` — takes an explicit
//!   [`crate::rounding::RoundingMode`] for users whose accounting rules
//!   mandate a non-default rule.
//! - `with_scale::<TARGET>()` — builder-style alias for `rescale`.
//!
//! Scale-up direction (target > source) is always exact: the stored
//! integer is multiplied by `10^diff`. Scale-down direction (target <
//! source) discards fractional digits using the requested rounding
//! mode.
//!
//! Overflow on the scale-up direction is detected via `checked_mul`
//! and panics with a clear message in both debug and release builds.

use crate::core_type::{D38, D9, D18};

// The rescale / rescale_with methods are emitted by
// `crate::macros::rescale::decl_decimal_rescale!` — same macro for
// every width; wide tiers receive it from `macros::full`.
crate::macros::rescale::decl_decimal_rescale!(D38, i128);
crate::macros::rescale::decl_decimal_rescale!(D18, i64);
crate::macros::rescale::decl_decimal_rescale!(D9, i32);