Skip to content

stat: incorrect rounding of fractional pre-epoch timestamps with precision #14976

Description

@mattsu2020

Description

stat produces incorrect output for fractional timestamps before the Unix epoch when precision is specified.

For example:

-0.876543211

%.1Y -> -0.9
%.3Y -> -0.877

GNU coreutils produces:

%.1Y -> -0.8
%.3Y -> -0.876

The fractional value should be truncated toward zero when reducing precision.

Related: #14705

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions