From: mohanson Date: Mon, 15 Dec 2025 07:06:48 +0000 (+0800) Subject: math/pow10: remove overlapping boundary (n=0) X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c04335e33a6915ae4edc9c9f94a909a46557f99a;p=gostls13.git 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 Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI Auto-Submit: Robert Griesemer --- diff --git a/src/math/pow10.go b/src/math/pow10.go index c31ad8dbc7..6f84db0023 100644 --- a/src/math/pow10.go +++ b/src/math/pow10.go @@ -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] }