You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
time.Round uses r+r < d to decide whether the remainder is above or below the halfway (round up or round down) point. This is wrong when r+r wraps negative, because it should be > d but looks < d.
No one will ever care about rounding to a d > 2^62 (d > 146 years), but might as well get it right.
CL on its way.
The text was updated successfully, but these errors were encountered:
When generating a random int8, uint8, int16, uint16, int32, uint32,
quick.Value chooses among all possible values.
But when generating a random int64 or uint64, it only chooses
values in the range [-2⁶², 2⁶²) (even for uint64).
It should, like for all the other integers, use the full range.
If it had, this would have caught #19807 earlier.
Instead it let us discover the presence of #19809.
While we are here, also make the default source of
randomness not completely deterministic.
Fixes#19808.
Change-Id: I070f852531c92b3670bd76523326c9132bfc9416
Reviewed-on: https://go-review.googlesource.com/39152
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
time.Round uses r+r < d to decide whether the remainder is above or below the halfway (round up or round down) point. This is wrong when r+r wraps negative, because it should be > d but looks < d.
No one will ever care about rounding to a d > 2^62 (d > 146 years), but might as well get it right.
CL on its way.
The text was updated successfully, but these errors were encountered: