Skip to content Skip to sidebar Skip to footer

Why Does Type-conversion/multiplication Fail In Python For Certain Cases?

I'm certainly a newbie to Python. Hence, I'm struggling to understand the results that the following bit of code gives me for i = 15 and i = 21. In all other cases is does what I e

Solution 1:

I think this link should give you an insight:

Why Are Floating Point Numbers Inaccurate?

It is understandable since the results can be slightly different due to precision if compared between how different languages deal with them. A quick example between using in python and just googling the answer:

Python example

Google example


Post a Comment for "Why Does Type-conversion/multiplication Fail In Python For Certain Cases?"