What defines floating point precision in python?

后端 未结 2 549
迷失自我
迷失自我 2021-01-06 03:29

I learnt of the \"exactly equal to\" operator in Erlang, which compares not only values, but also data types of numbers, and I was curious about how things work in Python an

相关标签:
2条回答
  • 2021-01-06 03:49

    Please check with the Python documentation:

    http://docs.python.org/tutorial/floatingpoint.html

    0 讨论(0)
  • It's a peril of using floating-point numbers.

    If you need precision at this deep a level, use the Decimal type.

    More here: http://docs.python.org/library/decimal.html

    0 讨论(0)
提交回复
热议问题