mattprecious / protogram

Quick and easy proto deserialization
https://mattprecious.github.io/protogram/
Apache License 2.0
113 stars 2 forks source link

Guess when value is a float based on hueristic #36

Open JakeWharton opened 4 years ago

JakeWharton commented 4 years ago

Floats typically have a mantissa and exponent which has a very distinct bit pattern. When both are non-zero (or only the exponent) we likely have a float and should assume so and display the integer value only as a fallback (similar to how floats are displayed today).