I am new to python, I am rewriting program from VBA Excel to Python.
I need accurate calculations but cannot figure out an appropriate way of doing so.
Example:
aa = 0.000016
bb = 0.000016
cc = aa*bb # which gives 2.5599999999999996e-12
a = decimal.Decimal('0.0000016')
b = decimal.Decimal('0.0000016')
c = a*b # which gives 2.56E-12
but when I do :
ccc= aa*b
It gives me an error
I need a way to either perform math with all Decimal('') numbers or make float numbers more accurate (no additional decimal numbers (0.0016 instead of 0.0015999996))