Fractional seconds are all very well but a number can't represent 1 millisecond accurately because 0.001 isn't easily expressible as a sum of powers of two.
Users of this library probably expect millisecond accuracy but not submillisecond accuracy so:
- Add a
milliseconds field to Timestamp, so it's not necessary to represent milliseconds as fractions of a second.
- Replace reference seconds with reference milliseconds.
- Consider using
bigint for reference milliseconds to ensure a wide range of valid dates.
Fractional seconds are all very well but a
numbercan't represent 1 millisecond accurately because0.001isn't easily expressible as a sum of powers of two.Users of this library probably expect millisecond accuracy but not submillisecond accuracy so:
millisecondsfield toTimestamp, so it's not necessary to represent milliseconds as fractions of a second.bigintfor reference milliseconds to ensure a wide range of valid dates.