[Tinyos-help] on using float or double types in TinyOS

Nouha Baccour nouha.baccour at gmail.com
Tue Mar 24 02:34:58 PDT 2009


Hi all,

I am programming with Tinyos/TOSSIM 2. Particularly I am working on
CTP data collection protocol.

Meanwhile, I needed to define float (or double) variables. I found
many problems like "floating point exception", other issues related to
casting...
Finally I was able to integrate my float variables. However, I don’t
know what are the consequences of defining these float variables.
In fact, I remarked that tinyos community avoids using floats or
double. For example, for the PRR (packet reception ratio) that can be
found in LinkEstimationP.nc, the authors, multiply PRR by 100 in order
to have integer (uint8_t) PRR, between 0 and 100, instead of float
PRR, between 0 and 1!!!
This is just an example but there are more.

So I would like to know what is the problem by using real variables.

Can anyone feedback on that?

Thanks in advance

Nouha



More information about the Tinyos-help mailing list