Skip to content

Commit

Permalink
show rounded number
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Jun 20, 2024
1 parent 4693f66 commit bf9b11f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/examples/numbers/float_precision_rounded.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
print(x) # 0.30000000000000004
print(y) # 0.3

print(round(x, 10))
if round(x, 10) == round(y, 10):
print("They are equal")
else:
Expand Down

0 comments on commit bf9b11f

Please sign in to comment.