hi
i'm a newbie to tinyos and im facing a weird problem dealing with
floating point numbers:
1) I tried using Printf interface to print the floating point numbers
using %f and %lf arguments and by storing the number in float and
double datatypes and my using the number directly as in argument. In
all these cases the only thing printed is an "f". i had the impressing
that the C data types work fine in nesC but there seems to be some
problem in this case.
2) I tried comparing two floating point numbers by:
2.1) Storing both number in float data type and then both in
double data type such as:
x=ran/256; //where ran is an uint8_t storing a
random number generated by RandomC
y=.5;
if(x<y)
printf("less");
else
printf("more");
PrintfFlush.flush();
2.1) by comparing the numbers directly
if(ran/256<.5)
printf("less")
else
printf("more")
because i'm printing 'ran' before this code, i know the comparison is
giving wrong results.
I have tried searching the net for tips on dealing with floating point
number in nesC but couldnt fine anything.
Could you please take a moment and help me out with this.
Thank you
Tarun
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help