]> Cypherpunks repositories - gostls13.git/commit
math/big: add support for general encoding interfaces
authorMichael T. Jones <mtj@google.com>
Thu, 13 Feb 2014 16:42:19 +0000 (08:42 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 13 Feb 2014 16:42:19 +0000 (08:42 -0800)
commiteea28f6701ac888d5613470a88d09b634efc1d75
treee0ef06bb8b8d8a15b6932ef171cb4897dc911d92
parente0dee49688c1c767e2f81a4dab824ba0be36dcbb
math/big: add support for general encoding interfaces
TextMarshaller and TextUnmarshaller to ease transport of
unlimited precision rational numbers.

Fixes #7287.

Consists of encode and decode functions and two test
functions, one using JSON and one using XML. Each
verifies round trips for integers (rationals with
denominator == 1) and for fractional vaues.

LGTM=gri
R=gri, cookieo9, bradfitz, mtj
CC=golang-codereviews
https://golang.org/cl/61180043
src/pkg/math/big/rat.go
src/pkg/math/big/rat_test.go