func TestDecodeBigReal(t *testing.T) { var hugeFloat big.Float hugeFloat.SetString("3.14e+99999") data := fmt.Sprintf("<real>%s</real>", hugeFloat.String()) decoder := baseDecoder{nil, xml.NewDecoder(bytes.NewReader([]byte(data)))} value, err := decoder.NextValue() assert.NoError(t, err) assert.Equal(t, hugeFloat, value) }
func writeBigFloat(e *xml.Encoder, val *big.Float) error { return e.EncodeElement(val.String(), realStartElement) }
func floatToJSONNumber(f *big.Float) json.Number { return json.Number(f.String()) }