]> Cypherpunks repositories - gostls13.git/commit
math/big: fix big.Exp and document better
authorRobert Griesemer <gri@golang.org>
Tue, 16 Oct 2012 20:46:27 +0000 (13:46 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 16 Oct 2012 20:46:27 +0000 (13:46 -0700)
commit7565726875d96e4a2bd927ebabc5ea614e602ac4
tree5a0ba740736783aba86e1ffb138dddf90e32a099
parentcfa1ba34cc98c5f804d5ab9672b09acf43fee102
math/big: fix big.Exp and document better

- always return 1 for y <= 0
- document that the sign of m is ignored
- protect against div-0 panics by treating
  m == 0 the same way as m == nil
- added extra tests

Fixes #4239.

R=agl, remyoudompheng, agl
CC=golang-dev
https://golang.org/cl/6724046
src/pkg/math/big/int.go
src/pkg/math/big/int_test.go
src/pkg/math/big/nat.go