1
0
mirror of https://github.com/golang/go synced 2024-11-26 02:27:56 -07:00

math/big: fix comment typo in natdiv.go

Comment in line 395:
[x₀ < S, so S - x₀ < 0; drop it]
Should be:
[x₀ < S, so S - x₀ > 0; drop it]

The proof is based on S - x₀ > 0, thus it's a typo of comment.

Fixes #68466

Change-Id: I68bb7cb909ba2bfe02a8873f74b57edc6679b72a
GitHub-Last-Rev: 40a2fc80cf
GitHub-Pull-Request: golang/go#68487
Reviewed-on: https://go-review.googlesource.com/c/go/+/598855
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
withsky 2024-07-17 12:06:34 +00:00 committed by Gopher Robot
parent 90c6558b6a
commit fc51e5023e

View File

@ -392,7 +392,7 @@ Proof that q ≤ q̂:
(1/y)·((x - y + 1)·S - x) [above: ·y x - y + 1]
= (1/y)·(x·S - y·S + S - x) [distribute S]
= (1/y)·(S - x - y·S) [-x = -x·S - x]
> -y·S / y [x < S, so S - x < 0; drop it]
> -y·S / y [x < S, so S - x > 0; drop it]
-1 [y·S y]
So - q > -1.