pkg maps, func EqualFunc[$0 interface{ ~map[$2]$3 }, $1 interface{ ~map[$2]$4 }, $2 comparable, $3 interface{}, $4 interface{}]($0, $1, func($3, $4) bool) bool #57436
pkg maps, func Keys[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0) []$1 #57436
pkg maps, func Values[$0 interface{ ~map[$1]$2 }, $1 comparable, $2 interface{}]($0) []$2 #57436
-pkg math/big, method (*Int) ToFloat64() (float64, Accuracy) #56984
+pkg math/big, method (*Int) Float64() (float64, Accuracy) #56984
pkg net/http, method (*ProtocolError) Is(error) bool #41198
pkg net/http, method (*ResponseController) EnableFullDuplex() error #57786
pkg net/http, var ErrSchemeMismatch error #44855
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
<dd>
<p><!-- https://go.dev/issue/56984, CL 453115 -->
- The new <a href="/pkg/math/big/#Int.ToFloat64"><code>Int.ToFloat64</code></a>
+ The new <a href="/pkg/math/big/#Int.Float64"><code>Int.Float64</code></a>
method returns the nearest floating-point value to a
multi-precision integer, along with an indication of any
rounding that occurred.
return !x.neg && len(x.abs) <= 64/_W
}
-// ToFloat64 returns the float64 value nearest x,
+// Float64 returns the float64 value nearest x,
// and an indication of any rounding that occurred.
-func (x *Int) ToFloat64() (float64, Accuracy) {
+func (x *Int) Float64() (float64, Accuracy) {
n := x.abs.bitLen() // NB: still uses slow crypto impl!
if n == 0 {
return 0.0, Exact
}
}
-func TestToFloat64(t *testing.T) {
+func TestFloat64(t *testing.T) {
for _, test := range []struct {
istr string
f float64
}
// Test against expectation.
- f, acc := i.ToFloat64()
+ f, acc := i.Float64()
if f != test.f || acc != test.acc {
t.Errorf("%s: got %f (%s); want %f (%s)", test.istr, f, acc, test.f, test.acc)
}