Skip to content

Document rounding in std::time::Duration's subsec_millis etc.  #52263

Closed
@sunfishcode

Description

@sunfishcode

In std::time::Duration's documentation, it's stated how as_secs rounds, however it's not stated how sunsec_millis and subsec_micros round.

In the implementations:

pub const fn subsec_millis(&self) -> u32 { self.nanos / NANOS_PER_MILLI }

they round toward zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions