Commit d1210acf authored by Martin Möhrmann's avatar Martin Möhrmann Committed by Robert Griesemer
Browse files

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: default avatarRuss Cox <rsc@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 3b63b69d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment