Float vs. double in math.h and arduino libraries
before far down road, thought i'd ask opinions. want use of functions in math.h gps calculations ( see http://www.movable-type.co.uk/scripts/latlong.html bunch of useful formulas). math.h requires use of type double rather type float. recognize on avr devices both types use 4 bytes of storage. real question types interchangeable? they appear have different ranges , degrees of precision. there need explicit conversion or typecasting, or should avoid arduino functions , use math.h calls math?
thanks.
ed
thanks.
ed
float , double same on arduino , therefore interchangable. avr gcc compiler implements both float , double 32-bit ieee 754.
you may need test few trial values see if can sufficient accuracy. interested hear results.
good luck!
you may need test few trial values see if can sufficient accuracy. interested hear results.
good luck!
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Float vs. double in math.h and arduino libraries
arduino
Comments
Post a Comment