OK, I know that there was many question about pow function and casting it\'s result to int, but I couldn\'t find answer to this a bit specific question.
OK, this is
To add to the other answers here: just generally be very careful when working with floating point values.
I highly recommend reading this paper (even though it is a long read): http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floating-point-article.pdf
Skip to section 3 for practical examples, but don't neglect the previous chapters!