Home  >  Article  >  Backend Development  >  Python method to compare whether two floating point numbers are equal

Python method to compare whether two floating point numbers are equal

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-06-15 16:15:3012083browse

How does python compare whether two floating point numbers are equal?

Related recommendations: "python video"

Python method to compare whether two floating point numbers are equal

float type cannot Compare equal or unequal, but you can compare >, 95ec6993dc754240360e28e0de8de30a=, 00bd2f87969d0b57e8b04a323a6aea06=" or "d1900a237b1c6cd7fdd3a9bf2a923974" to compare which one is bigger and which one is smaller.

float a=10.222222225,b=10.222222229

The above is the detailed content of Python method to compare whether two floating point numbers are equal. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn