Created
May 10, 2018 03:42
-
-
Save Fhernd/b6272482cf0e3c889c7dc9ca2bbae5d9 to your computer and use it in GitHub Desktop.
Cálculos precisos con decimales. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import Decimal | |
numero_1 = 4.2 | |
numero_2 = 2.1 | |
print(numero_1 + numero_2) | |
print((numero_1 + numero_2) == 6.3) | |
numero_1 = Decimal('4.2') | |
numero_2 = Decimal('2.1') | |
print(numero_1 + numero_2) | |
print((numero_1 + numero_2) == Decimal('6.3')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment