I'm just a little confused by the question and the answer....
Why are you calculating sin() of Pi * 100?
My poor calculator just throws up it's little hands
even though it _should_ know it has 'wrapped-around'
a few times. And when I give it the truncated base values
of N*Pi as shown it comes up with -3.yada e-7 (which
for most practical purposes is == 2.0e-15, or even 0).
Is that difference the error under discussion?
In any case, once you get to the Mote hardware rather
than simulation, you may find things to be worse. Or
if not mathematically less correct, at least memory/
processor hoggishly annoying, since there is no FP
hardware available on board. You may want to review
what calculations, with what precision, you do on
the mote as to how much time and memory they take.
MS
Aurélien Francillon wrote:
Hi,
Le vendredi 09 mars 2007 10:26, frenci a écrit :
Hi,
I'am a PhD student and I'm trying to write a program that calculate the
sin() function.
...
You don't need those two, and it may break if you build for a real target:
PFLAGS+=-I/usr/include
...
includes math;
...
0: sin(0.000000e+00) = 0.000000e+00
0: sin(3.141593e+02) = 1.964791e-15
0: sin(6.283185e+02) = 3.929582e-15
0: sin(9.424778e+02) = -5.094905e-14
0: sin(1.256637e+03) = 7.859165e-15
0: sin(1.570796e+03) = -1.607063e-13
0: sin(1.884956e+03) = -1.018981e-13
0: sin(2.199115e+03) = -2.704636e-13
0: sin(2.513274e+03) = 1.571833e-14
Why sin() function dosn't run well??
The results are ok, you give an approximates value of Pi, 2Pi, 3Pi to sin
it returns approximates values of zero ...
Cheers,
Aurélien
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help