mirror of
https://github.com/golang/go
synced 2024-11-18 12:14:42 -07:00
math/big: better documentation for Rat.Float64
R=adonovan, r CC=golang-dev https://golang.org/cl/11961043
This commit is contained in:
parent
64db2ec915
commit
5bd61e0603
@ -164,8 +164,9 @@ func quotToFloat(a, b nat) (f float64, exact bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Float64 returns the nearest float64 value for x and a bool indicating
|
// Float64 returns the nearest float64 value for x and a bool indicating
|
||||||
// whether f represents x exactly. The sign of f always matches the sign
|
// whether f represents x exactly. If the magnitude of x is too large to
|
||||||
// of x, even if f == 0.
|
// be represented by a float64, f is an infinity and exact is false.
|
||||||
|
// The sign of f always matches the sign of x, even if f == 0.
|
||||||
func (x *Rat) Float64() (f float64, exact bool) {
|
func (x *Rat) Float64() (f float64, exact bool) {
|
||||||
b := x.b.abs
|
b := x.b.abs
|
||||||
if len(b) == 0 {
|
if len(b) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user