From: Robert Griesemer Date: Tue, 3 Mar 2015 20:53:41 +0000 (-0800) Subject: math/big: remove Float.Lsh/Rsh; added shift example X-Git-Tag: go1.5beta1~1719 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef0b03137d18f42337a4cbd4915bf91942bad750;p=gostls13.git math/big: remove Float.Lsh/Rsh; added shift example Shifts are trivially implemented by combining Float.MantExp and Float.SetMantExp. Change-Id: Ia2fb49297d8ea7aa7d64c8b1318dc3dc7c8af2f7 Reviewed-on: https://go-review.googlesource.com/6671 Reviewed-by: Alan Donovan --- diff --git a/src/math/big/float.go b/src/math/big/float.go index fa0cb2ba89..e24961c61a 100644 --- a/src/math/big/float.go +++ b/src/math/big/float.go @@ -88,8 +88,8 @@ const ( // Accuracy describes the rounding error produced by the most recent // operation that generated a Float value, relative to the exact value. -// The accuracy may be Undef (either Below or Above) for operations on -// and resulting in NaNs. +// The accuracy may be Undef for operations on and resulting in +// NaNs since they are neither Below nor Above any other value. type Accuracy int8 // Constants describing the Accuracy of a Float. @@ -278,6 +278,8 @@ func (x *Float) MantExp(mant *Float) (exp int) { // z.SetMantExp(±Inf, exp) = ±Inf // z.SetMantExp( NaN, exp) = NaN // +// z and mant may be the same in which case z's exponent +// is set to exp. func (z *Float) SetMantExp(mant *Float, exp int) *Float { if debugFloat { validate(z) @@ -1449,44 +1451,6 @@ func (z *Float) Quo(x, y *Float) *Float { return z } -// TODO(gri) eliminate Lsh, Rsh? We can do the same with MantExp, SetMantExp. - -// Lsh sets z to the rounded x * (1<