...
what are you trying to illustrate?

Originally Posted by
cball
When I key in 0.1 interval, it display the values from 0 to 1. however, when I key in 0.01, it only display the values from 0 to 0.99. I don't get it. Can any one explain to me ? thank you so much.
...
0.01 added together 100 times isn't necessarily the same as 0.1 added together 10 times.


Originally Posted by
cball
0.01, it only display the values from 0 to 0.99
try.c
Code:
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(int args, char *argv[]) {
double interval = 0.0, loops, i, j;
interval = atof(argv[1]);
for (loops=(1/interval); j<=loops; i=(interval*++j)) {
printf("sin(%f)=%d\n", i, sin(i));
printf("cos(%f)=%d\n", i, cos(i));
}
return 0;
}
gcc try.c -o try.exe
Code:
:> try 0.01
sin(0.000000)=3760128
cos(0.000000)=0
sin(0.010000)=-384440313
cos(0.010000)=615356330
sin(0.020000)=-844801945
cos(0.020000)=-1788506730
sin(0.030000)=-241801274
cos(0.030000)=1513446646
etc...
sin(1.000000)=-1895232274
cos(1.000000)=263521932