Doubles vs Floats in the SDK

Looking at the current Connect IQ SDK, there seems to be a rather inconsistent use of Doubles and Floats. Would it be possible to use Floats by default in the SDK and then add methods for Doubles in the few places where it makes sense or is necessary?

Background:
  • As shown by Travis and others, some of the objects in Connect IQ are pretty expensive to use.
  • Converting between Doubles and Floats might be cheap in terms of time, but will easily leave us with the double number of objects unless you are very, very careful to null out old variables and the GC of Connect IQ is very good...
  • In some places, the API returns Doubles - a very current example is Location.toRadians() - whereas other parts of the API only operates on Floats - e.g. all the methods of Math.
  • Floats - assuming they are based on IEEE 754 - have 23 bits of significand, 8 bits of exponent, and 1 sign bit. This means you have a minimum precision of 1/2^23 = 1/8388608. In most cases, you also have the sign, which means you actually have the double precision. For the earth, with a circumference of ~40.075 km, this gives you a minimum precision of 2.3m. Given the normal accuracy of GPS (6m for 920xt according to fellrnr - which is way better than what I see), you really only need more than Float in very, very few cases.
  • If you want to find a distance or heading, you must use the methods of Math and therefore must convert to Floats...


So... can you please use Floats by default in the SDK and then maybe add special Double versions where needed?
  • 23 bits are stored, but the total precision is 24 bits because there is an implicit leading bit... So with the sign you could even achieve a precision of 1.2m.

    But there is the problem of interpretation of the stored numbers to real coordinates...