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

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!


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Float vs. double in math.h and arduino libraries


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums