mirror of
https://github.com/golang/go.git
synced 2026-02-07 02:09:55 +00:00
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:
parent
a1150b5017
commit
c04335e33a
1 changed files with 1 additions and 1 deletions
|
|
@ -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]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue