Files
93b88540dce34170bb1bd1f335cfff2bdd52ca94
swift /test
Alistair Coles 93b88540dc Timestamp: fix inconsistent raw and normal values
Previously it was possible for a Timestamp to have inconsistent raw
and normal values. For example:
>>> ts1 = Timestamp(1755077566.523385)
>>> (ts1.normal, ts1.raw, (~ts1).normal)
('1755077566.52339', 175507756652338, '8244922433.47661')
This results in the invert function not being reliably reversible:
(~(~ts1)).normal
'1755077566.52338'
The cause is that the normal value is based on Timestamp.timestamp
which preserves the precision of the value given to the constructor,
whereas the invert function uses the limited precision raw value.
This patch forces Timestamp.timestamp to have the limited precision
value of Timestamp.raw.
Change-Id: I4e7fd6078aae3f284628303f20ced66aa702c466
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年08月13日 13:39:29 +01:00
..
2025年03月06日 17:10:04 -08:00
2025年07月18日 18:29:20 +00:00
2025年05月15日 07:40:39 +00:00
2025年05月15日 07:40:39 +00:00