Development · Evolving reference
DurationRounding
Selects explicit mathematical rounding when converting finite time units.
Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →
Module std.time
import std.time;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
DurationRounding
pub enum DurationRoundingSelects explicit mathematical rounding when converting finite time units.
Exact never truncates. Floor/Ceil refer to signed numerical direction, so a negative magnitude may round differently from a positive one. NearestEven breaks exact half-tick ties toward an even target count. No mode yields infinity.
DurationRounding.Exact
Exact;Rejects any fractional target tick.
DurationRounding.Floor
Floor;Rounds toward negative infinity.
DurationRounding.Ceil
Ceil;Rounds toward positive infinity.
DurationRounding.NearestEven
NearestEven;Rounds to nearest, breaking equal-distance ties toward even.
Documentation snapshot: October 24, 2026 About versions ↗