I'm using Google App Engine for Java with Objectify 4.0b1 to persist a POJO into the Datastore. That POJO has a few Float properties. If I set one of them to a Float equal to 51.5221, save it, then look in to console at that entity, the value has become 51.522098541259766. Why?
The 51.5221 value has come from parsing a String using Float.valueOf(), in case that makes any difference.
I expect some people will tell me to use BigDecimal if I want control of the precision. Fine, but where is the extra data coming from? Is it strictly necessary to use BigDecimal or store Integers and convert back to Floats later? I'd like to avoid both.