]> Cypherpunks.ru repositories - gostls13.git/commit
math/big: implement Float.Scan, type assert fmt interfaces to enforce docs
authorEmmanuel Odeke <emm.odeke@gmail.com>
Mon, 10 Oct 2016 05:45:17 +0000 (22:45 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 19 Oct 2016 03:25:30 +0000 (03:25 +0000)
commitf36e1adaa2c72d74dc669b596ea1c4df5e938def
tree3404c0d617f987a68e2d7251aea48e974b9b7726
parentead08e91f6468ab1c35c250ec487935103c580f6
math/big: implement Float.Scan, type assert fmt interfaces to enforce docs

Implements Float.Scan which satisfies fmt.Scanner interface.
Also enforces docs' interface implementation claims with compile time
type assertions, that is:
+ Float always implements fmt.Formatter and fmt.Scanner
+ Int always implements fmt.Formatter and fmt.Scanner
+ Rat always implements fmt.Formatter
which will ensure that the API claims are strictly matched.

Also note that Float.Scan doesn't handle ±Inf.

Fixes #17391

Change-Id: I3d3dfbe7f602066975c7a7794fe25b4c645440ce
Reviewed-on: https://go-review.googlesource.com/30723
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/example_test.go
src/math/big/floatconv.go
src/math/big/floatconv_test.go
src/math/big/ftoa.go
src/math/big/intconv.go
src/math/big/ratconv.go