diff --git a/aula55.py b/aula55.py new file mode 100644 index 0000000..a879546 --- /dev/null +++ b/aula55.py @@ -0,0 +1,14 @@ +""" +Imprecisão de ponto flutuante +Double-precision floating-point format IEEE 754 +https://en.wikipedia.org/wiki/Double-precision_floating-point_format +https://docs.python.org/pt-br/3/tutorial/floatingpoint.html +""" +import decimal + +numero_1 = decimal.Decimal('0.1') +numero_2 = decimal.Decimal('0.7') +numero_3 = numero_1 + numero_2 +print(numero_3) +print(f'{numero_3:.2f}') +print(round(numero_3, 2))