When I try to add a decimal value with an integer, I am getting a wrong answer.
Here's what I am doing: I am getting 4 numbers from a string like the following: 8' 9'' X 7' 4'' into 4 variables: v1, v2, v3, v4
Then I am dividing the 2nd and 4th numbers v2, v4 by 12 (to convert inches to feet in decimal) and saving them into two more variables v5, v6
So,
v5 = v2/12; // 9/12 = 0.75
v6 = v4/12; // 4/12 = 0.33
Everything is working fine till here, and it is giving the correct results. Then, when I try to add v1+v5, and v2+v6, I am getting a wrong answer.
v7 = v1+v5 // 8+0.75 should be 8.75; but I am getting 80.75
v8 = v2+v6 // 7+0.33 should be 7.33; but I am getting 70.33