avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Is there anything special about using the float or doubl


From: Alex Shepherd
Subject: [avr-gcc-list] Is there anything special about using the float or double data type
Date: Wed, 24 Sep 2003 11:23:24 +1200

Hi Guys,

Is there anything special about using the float or double data types in
AVR-GCC?

I have a look through the AVRLIB docs and it only mentions the special
math library. However I assume that the absence of anything on floats or
doubles to mean they just work!

One thing I would like to print the value of the float result without
using the printf libraries. Are there any ftoa() type functions. Maybe I
should simply cast the result back to int and print it that way.

I'm wanting to do a tiny bit of floating point math to calculate the
speed of a model railroad locomotive going past a couple of IR beam
sensors at a fixed spacing and time the period between beam breaks, to
get the time and then calculate the scaled speed.

This requires the following:

Speed = distance * scale factor / time

As all these are small values on a model I think I need to do this using
floats.

Comments?

Cheers

Alex Shepherd

Phone  (Home) +64 (7) 854 0819
Email: address@hidden 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]