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

3 views
Skip to first unread message

Wanbiao Ye (Gerrit)

unread,
Dec 15, 2025, 2:11:19 AM (yesterday) Dec 15
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Wanbiao Ye has uploaded the change for review

Commit message

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. Testing has shown
that this modification will not affect performance or assembly code
in linux/amd64.
Change-Id: Iefbc25a676242fabf272203a3e845363585bff56

Change diff

diff --git a/src/math/pow10.go b/src/math/pow10.go
index c31ad8d..6f84db0 100644
--- a/src/math/pow10.go
+++ b/src/math/pow10.go
@@ -33,7 +33,7 @@
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]
}

Change information

Files:
  • M src/math/pow10.go
Change size: XS
Delta: 1 file changed, 1 insertion(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Iefbc25a676242fabf272203a3e845363585bff56
Gerrit-Change-Number: 730060
Gerrit-PatchSet: 1
Gerrit-Owner: Wanbiao Ye <lacew...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Wanbiao Ye (Gerrit)

unread,
Dec 15, 2025, 10:17:46 PM (16 hours ago) Dec 15
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer and Russ Cox

Wanbiao Ye uploaded new patchset

Wanbiao Ye uploaded patch set #2 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
  • Russ Cox
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Iefbc25a676242fabf272203a3e845363585bff56
Gerrit-Change-Number: 730060
Gerrit-PatchSet: 2
Gerrit-Owner: Wanbiao Ye <lacew...@gmail.com>
Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Robert Griesemer <g...@golang.org>
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages