float128s everywhere for dates? · Issue #7139 · matplotlib/matplotlib · GitHub
Skip to content

float128s everywhere for dates? #7139

Description

@anntzer

The bad roundings that appear in #7138 (loss of microsecond precision for dates around today) make me wonder whether we should just switch to using float128s everywhere for date-related data.

Time is encoded as seconds since 0001-01-01 UTC, so float64s (53 bits) can keep microsecond precision for a timedelta up to 2**53 / 1e6 / 3.154e7 ~ 285 years (3.154e7s/y), which does not go up to today. On the other hand float128s offer 113 bits of precision, i.e. ~3e20 years -- that should be safe, even if we switch to nanosecond precision :-)

On the other hand I don't actually ever use dates in plots so I don't know if it's really worth it.

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