import the decimal module to use the Decimal number class. : Decimal : Data Type PYTHON TUTORIALS


PYTHON TUTORIALS » Data Type » Decimal »

 

import the decimal module to use the Decimal number class.


import decimal 


dec = decimal.Decimal('.1')
print dec
dec + decimal.Decimal('1.0')
print dec + decimal.Decimal('1.0')



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Data Type
» Decimal