For some reason, when looping through and adding 0.01 to a variable, it will sometimes result in adding 0.01999999999999999 instead of just 0.01. Here is the a screenshot with the console output: console log And here is the code:
var num1 = 0.00;
var num2 = 0.00;
var maxNum = 5.55;
while(num1 <= maxNum){
console.log('outer num1: ' + num1);
console.log('outer num2: ' + num2);
console.log('');
while(num2 <= maxNum){
console.log('inner num1: ' + num1);
console.log('inner num2: ' + num2);
console.log('');
num2 = num2 + 0.01;
}
num1 = num1 + 0.01;
}