math/pow10: remove overlapping boundary (n=0)

Both the first and second conditions include n=0, creating an
implicit logic that relies on order of evaluation.

Change-Id: Iefbc25a676242fabf272203a3e845363585bff56
Reviewed-on: https://go-review.googlesource.com/c/go/+/730060
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
This commit is contained in:
mohanson 2025-12-15 15:06:48 +08:00 committed by Gopher Robot
parent a1150b5017
commit c04335e33a

View file

@ -33,7 +33,7 @@ func Pow10(n int) float64 {
return pow10postab32[uint(n)/32] * pow10tab[uint(n)%32]
}
if -323 <= n && n <= 0 {
if -323 <= n && n < 0 {
return pow10negtab32[uint(-n)/32] / pow10tab[uint(-n)%32]
}