aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHanjun Kim <hallazzang@gmail.com>2020-04-12 13:41:46 +0000
committerRobert Griesemer <gri@golang.org>2020-04-15 00:32:18 +0000
commit5a447c0ae9f43b608314d0fd2f3141fa9c5146ff (patch)
tree2fcd97a08d135807a7aa736a1761bc2bc28015b2 /src
parent75f499e3a0e8830efb861c9ba6ca61bc03583962 (diff)
downloadgo-5a447c0ae9f43b608314d0fd2f3141fa9c5146ff.tar.xz
math/big: fix typo in documentation for Int.Exp
Fixes #38304 Also change `If m > 0, y < 0, ...` to `If m != 0, y < 0, ...` since `Exp` will return `nil` whatever `m`'s sign is. Change-Id: I17d7337ccd1404318cea5d42a8de904ad185fd00 GitHub-Last-Rev: 23995103000505dbf35aa29a717470c4da638fda GitHub-Pull-Request: golang/go#38390 Reviewed-on: https://go-review.googlesource.com/c/go/+/228000 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/math/big/int.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/big/int.go b/src/math/big/int.go
index 18f122e953..8816cf5266 100644
--- a/src/math/big/int.go
+++ b/src/math/big/int.go
@@ -465,8 +465,8 @@ func (x *Int) TrailingZeroBits() uint {
}
// Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z.
-// If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m > 0, y < 0,
-// and x and n are not relatively prime, z is unchanged and nil is returned.
+// If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m != 0, y < 0,
+// and x and m are not relatively prime, z is unchanged and nil is returned.
//
// Modular exponentiation of inputs of a particular size is not a
// cryptographically constant-time operation.