]> Cypherpunks repositories - gostls13.git/commit
math/big: math.Exp should return result >= 0 for |m| > 0
authorRobert Griesemer <gri@golang.org>
Thu, 2 Oct 2014 20:02:25 +0000 (13:02 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 2 Oct 2014 20:02:25 +0000 (13:02 -0700)
commit28ddfb090c2824d60e30007cf171b5dc1e8935e2
treef87dfd16eb329d48501e74fc671fb4694c11c5fc
parent1dba6eb4645f0528ed1ce5e0dd5a4661afa8bd07
math/big: math.Exp should return result >= 0 for |m| > 0

The documentation states that Exp(x, y, m)
computes x**y mod |m| for m != nil && m > 0.
In math.big, Mod is the Euclidean modulus,
which is always >= 0.

Fixes #8822.

LGTM=agl, r, rsc
R=agl, r, rsc
CC=golang-codereviews
https://golang.org/cl/145650043
src/math/big/int.go
src/math/big/int_test.go