I was doing my program for a school project when I encountered a problem which I'm unable to understand after trying many different methods to resolve it. I have a function that does a simple mathematical operation like this:
def pikkus(kogupikkus, loimed):
summa = loimed * (kogupikkus * 1.2 + 0.5)
return (summa)
Now, when giving the function numbers 4.9 and 140 (in this same order), it returns me a number which isn't true, because 4.9 * 1.2 + 0.5 = 6.38 and 140 * 6.38 = 893.2, but all I get is 893.1999999999999, but it's not even true, try doing 140 * 6.38 yourself - it's exactly 893.2 PS! It has to be a float number, it's in my project instructions that it can't be rounded to an integer, so answers like "just put a round() infront and you are good" don't help me at all.