Compare two float variables in C++

前端 未结 3 1518
悲&欢浪女
悲&欢浪女 2021-01-25 18:10

I have read multiple articles regarding floating point variables comparison, but failed to understand and get the required knowledge from those articles. So, here I am posting t

3条回答
  •  無奈伤痛
    2021-01-25 18:42

    It's because floats have 7 digit precision. If you want better precision you need to use double or long double.

提交回复
热议问题