DurationScale
Stores a positive reduced source-to-target duration count multiplier.
Module std.time
import std.time;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
DurationScale
pub struct DurationScaleStores a positive reduced source-to-target duration count multiplier.
Declarative defaults form the identity scale; other values come from validated DurationPeriod algebra through a named factory. Conversion uses a bounded two-word256-bit product and exact quotient/remainder so intermediate overflow alone never rejects a representable unsigned128 target magnitude. No allocation, storage retention, floating approximation or synchronization is introduced.
DurationScale.fn
pub readonly const fn ConvertMagnitude(Magnitude: u128, Negative: bool, Rounding: DurationRounding)
-> Result<u128, DurationError>Converts an exact integer magnitude using selected signed rounding direction. Magnitude: Unsigned count magnitude, including the full signed-minimum magnitude. Negative: Whether the original nonzero count has a negative sign. Rounding: Exact, mathematical floor/ceil or nearest-even selection. Return: Converted unsigned magnitude or precision/range failure; never Endless.