This
double realPos = 0; //Real position
for(unsigned long i = 0; i < steps; i++)
{
realPos += (1/k);
}
is a terrible way to add up lots of small numbers.
This
double realPos = 0; //Real position
for(unsigned long i = 0; i < steps; i++)
{
realPos += (1/k);
}
is a terrible way to add up lots of small numbers.