0
Hi, I have a question about the code in description. Why x*=1.07 is not the same as x+=x*7/100
6 Answers
+ 3
It is explained here:
https://docs.python.org/3/tutorial/floatingpoint.html
+ 1
It is the same but often you get rounding differences.
0
Yes, I obtain a rounding difference and so there is a bug in my code. So, I would like to understand why there is this rounding difference. Thank you for your help :)
0
The tax that is calculated by multiplying the total cost by 1.07, instead of adding 7% to the total cost is a more accurate way of calculating the tax, since it takes into account the fact that the tax is applied to the total cost of the order.
0
Thank you, for your help! :)
0
How we can write this :
x*=0.07
Y=x*7/100