can you add an approximation of the result in the command? (ex: the biggest precision in the values is 0.1, so it won't show after 4.0) meen while, thank you.
> can you add an approximation of the result in the command? I don't really understand what you're asking here. If you're asking for the behaviour of multiplication to change so that it becomes more do-what-I-mean-ish, that's not going to happen. You could try writing your own DWIM-style multiplication if that's what you want, but the basic multiplication operator should stay as it is now: a simple wrapper around the C multiplication, which on most machines has a simple, easily-stated and well-defined behaviour: return me the floating-point number that's closest to the exact mathematical result of the multiplication.
@Liam, try using the "decimal" module instead. That follows rules much like the ones people learn as kids. >>> from decimal import Decimal as D >>> D("0.1") * 3 # decimal results are computed exactly Decimal('0.3') >>> D("1.01") - D(".01") # number of significant digits is preserved Decimal('1.00') Etc.