Nothing wrong, it is a decimal to binary conversion error.
To get accurate results you have to use Decimal type.

from decimal import *
test1 = Decimal('250.90')
...


On Jan 21, 4:32 pm, Kenneth Lundström <kenneth.t.lundst...@gmail.com>
wrote:
>      test1 = 250.90
>      test2 = 47.90
>      test3 = 99.90
>
>      test4 = test1 + test2 + test3
>
>      test5 = 398.70
>
>      test6 = test5 - test4
>
>      return test6
>
> This returns -5.68434188608e-14 not 0 as you would expect, or?
>
> Kenneth

Reply via email to