I am just doing some simple arithmetic calculations in PHP and getting very strange results. Below, I have mentioned what I am doing and what result I am getting:
1. $a = 191.39 - 147;
2. echo $a; //Print 44.39
3. echo (191.39 - 147); //Print 44.39
4. echo -44.39 + 44.39; //Print 0
5. echo -44.39 + $a; //Print -1.4210854715202E-14
6. echo -44.39 + (191.39 - 147); // Print -1.4210854715202E-14
Can someone please tell me, why I am getting different value in Line 5 and 6 as compared to Line 4? Because I am doing same thing in Line 4,5 and 6 but results are different.
Thanks in advance