JavaScript's brilliant solution is to just not have integers. At all. That's better, somehow?
>>> from decimal import *
>>> Decimal('0.3') == Decimal('0.1') + Decimal('0.2')
True
>>> Decimal('NaN') == Decimal('NaN')
False
>>>However, your code example makes the excellent point that python has such a library available, whereas Javascript does not. At least, not as easily as an import.