]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: better SetFloat64 example in doc
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 24 Sep 2016 13:53:09 +0000 (15:53 +0200)
committerRobert Griesemer <gri@golang.org>
Mon, 26 Sep 2016 18:30:35 +0000 (18:30 +0000)
Fixes #17221

Change-Id: Idaa2af6b8646651ea72195671d1a4b5c370a5a22
Reviewed-on: https://go-review.googlesource.com/29711
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/doc.go

index a3c23751ba491147f96ddbd55d6244e4bb2db205..65ed019b741d234639da9de682da0afb90d6965a 100644 (file)
@@ -31,7 +31,7 @@ setters, for instance:
 
        var z1 Int
        z1.SetUint64(123)                 // z1 := 123
-       z2 := new(Rat).SetFloat64(1.2)    // z2 := 6/5
+       z2 := new(Rat).SetFloat64(1.25)   // z2 := 5/4
        z3 := new(Float).SetInt(z1)       // z3 := 123.0
 
 Setters, numeric operations and predicates are represented as methods of