You're getting drift. 1/k doesn't convert perfectly into a binary real number, so it is approximated as well as it can be in 4 bytes of data. But when you add it repeatedly, many, many, many times, that very small difference gets multiplied. By the time you have added it 125629 times, it's that far off.
This is not an Arduino specific problem. Running that calculation in a C program on your PC will give you the same results. The difference is that on your PC, you can simply declare your float variables as double variables, and your precision gets much better. On the Arduino, doubles are just turned into floats, and you're stuck with the precision you get.
This program looks like it was designed to exhibit this problem. To eliminate the drift, you are supposed to do the actual formula calculation inside the for loop. Like so:
for(unsigned long i = 0; i < steps; i++)
{
realPos = i / k;
// Do useful stuff here with realPos
}
In most cases, you actually use realPos in the loop, and this will give you accurate data in the loop. And, at the end of the loop, when i is equal to steps, the result will be the same as cPos. But then it's the exact same calculation, so it should be.