1
0
mirror of https://github.com/golang/go synced 2024-11-20 04:54:44 -07:00
go/src/time
Martin Möhrmann d1210acffd time: correctly parse large input durations and avoid precision loss
Do not lose precision for durations specified without fractions
that can be represented by an int64 such as 1<<53+1 nanoseconds.
Previously there was some precision lost in floating point conversion.

Handle overflow for durations above 1<<63-1 nanoseconds but not earlier.

Add tests to cover the above cases.

Change-Id: I4bcda93cee1673e501ecb6a9eef3914ee29aecd2
Reviewed-on: https://go-review.googlesource.com/2461
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-15 00:15:58 +00:00
..
example_test.go
export_test.go
export_windows_test.go
format_test.go
format.go time: correctly parse large input durations and avoid precision loss 2015-01-15 00:15:58 +00:00
genzabbrs.go
internal_test.go
sleep_test.go time: panic with a more helpful error on use of invalid Timer 2014-10-21 13:26:40 +02:00
sleep.go time: panic with a more helpful error on use of invalid Timer 2014-10-21 13:26:40 +02:00
sys_plan9.go
sys_unix.go
sys_windows.go
tick_test.go
tick.go
time_test.go time: correctly parse large input durations and avoid precision loss 2015-01-15 00:15:58 +00:00
time.go
zoneinfo_abbrs_windows.go
zoneinfo_plan9.go
zoneinfo_read.go
zoneinfo_test.go
zoneinfo_unix.go
zoneinfo_windows_test.go
zoneinfo_windows.go
zoneinfo.go