math/big: add a comment for SetMantExp

Change-Id: I9ff5d1767cf70648c2251268e5e815944a7cb371
Reviewed-on: https://go-review.googlesource.com/c/go/+/233737
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
surechen 2020-05-13 17:03:36 +08:00 committed by Robert Griesemer
parent 3b6c812f3d
commit bd6dfe9a3e
1 changed files with 4 additions and 3 deletions

View File

@ -322,10 +322,11 @@ func (z *Float) SetMantExp(mant *Float, exp int) *Float {
mant.validate()
}
z.Copy(mant)
if z.form != finite {
return z
if z.form == finite {
// 0 < |mant| < +Inf
z.setExpAndRound(int64(z.exp)+int64(exp), 0)
}
z.setExpAndRound(int64(z.exp)+int64(exp), 0)
return z
}