protobuf-go/internal
Herbie Ong 84f0960b04 internal/encoding/text: format using 32 bitsize when encoding float32
When encoding/textpb marshals out float32 values, it was previously
formatting it as float64 bitsize since both float types are stored as
float64 and internal/encoding/text only has one Float type.  A
consequence of this is that the output may display a different value
than expected, e.g.  1.02 becomes 1.0199999809265137.

This CL splits Float type into Float32 and Float64 to keep track of
which bitsize to use when formatting.  Values of both types are still
stored as float64 to keep the logic simple.

Decoding will always use Float64, but users can ask for a float32 value
from it.

Change-Id: Iea5b14b283fec2236a0c3946fac34d4d79b95274
Reviewed-on: https://go-review.googlesource.com/c/158497
Reviewed-by: Damien Neil <dneil@google.com>
2019-01-18 17:54:23 +00:00
..
cmd reflect: switch MessageType.New to return Message 2019-01-09 20:29:29 +00:00
detrand internal/detrand: support disabling detrand 2018-11-29 07:49:45 +00:00
encoding internal/encoding/text: format using 32 bitsize when encoding float32 2019-01-18 17:54:23 +00:00
errors
flags
impl reflect: switch ExtensionType.New to return Value 2019-01-09 21:05:08 +00:00
legacy reflect: switch ExtensionType.New to return Value 2019-01-09 21:05:08 +00:00
pragma
protogen/goldentest protogen: annotate interface methods 2018-12-12 19:34:33 +00:00
scalar internal/scalar: add scalar package for primitive wrappers 2018-11-28 07:06:11 +00:00
set internal/set: add set package for set data structures 2018-08-09 21:46:35 +00:00
testprotos protogen: use _protoFile suffix for file descriptor variable 2019-01-14 20:23:59 +00:00
typefmt reflect/protoreflect: add HasJSONName, ReservedRanges, and ReservedNames 2018-12-07 20:10:15 +00:00
value reflect: switch MessageType.New to return Message 2019-01-09 20:29:29 +00:00