I'm making a math library because 0.1 + 0.2 DOES NOT = 0.30000000000004. But I ran into a really weird problem
I have an array:
var array = [1,2,3,".",4,5,6];
I want to split it into two parts so I...
var part1 = array;
var part2 = array;
And then...
for (var i = 4; i < 7; i++) {
part1[i] = 0;
};
So now part1 =
[1,2,3,".",0,0,0]
As it should but then I arrive at this problem. After I...
for (i = 2; i > -1; i--) {
part2[i] = 0;
};
Part1, part2 and array now =
[0,0,0,".",0,0,0]
This shouldn't happen, part2 should =
[0,0,0,".",4,5,6]
But it doesn't
???