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
Compute median as a + (b-a)/2 instead of (a + b)/2.
Add additional test cases.
Fixesgolang#65025.
Change-Id: Ib716a1036c17f8f33f51e33cedab13512eb7e0be
Reviewed-on: https://go-review.googlesource.com/c/go/+/554617
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Go version
go version devel go1.22-8eaa7935db Mon Jan 8 18:52:56 2024 +0000 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
mulRange(math.MaxUint64 - 3, math.MaxUint64) overflows the internal median computation
(reported by jannotti@gmail.com)
What did you see happen?
incorrect result / stack overflow
What did you expect to see?
correct result
The text was updated successfully, but these errors were encountered: