fix gcc warning by using an unsigned int for the loop variable

This commit is contained in:
neingeist 2013-12-08 23:23:45 +01:00
parent 30b4726cab
commit 2531b2b3c5

View file

@ -5,7 +5,7 @@ double approximate_pi(unsigned int steps) {
double approximate_pi = 4.0;
bool subtract = true;
for (int i = 2; i <= steps; i++) {
for (unsigned int i = 2; i <= steps; i++) {
if (subtract) {
approximate_pi -= (4.0 / (i * 2 - 1));
} else {