i am currently working on a matrice math lib in javascript which i have already finished my inverse function for 2x2, 3x3, and for 4x4 matrices using a adjugated cofactor mathod, when i went to multiply my inverse by my original matrice to get the identity matrix to validate my work i noticed a issue, while my diagonal of 1 was correct, where what should have been zeros where not in some places, i checked my work over several times with the help of external calculators and manually checking and i came to the conclusion it wasn't my multiplication.
i then decided to add the numbers for the number in question myself using javascript and the results are very confusing to say the least
4.210526315789474 + 0.6263157894736841 + -0.1578947368421052 + -4.678947368421052
when added in javascript output
8.881784197001252e-16
when added manually or using a calculator output
0.0000000000000009
so i did some more testing and decided to add
-4.836842105263157 + 4.836842105263158
to check if adding just the two sums would output the correct number and sure enough it did....
so my question is, why does
4.210526315789474 + 0.6263157894736841 + -0.1578947368421052 + -4.678947368421052
output the incorrect value, i am truly confused right now, thank you for the help in advanced,
my work environment is in chrome version +63 running js 1.7, all my output was to the developer console using console.log();