# Is it safe to compare rounded float values for equality?

**URL:** <https://discourse.julialang.org/t/is-it-safe-to-compare-rounded-float-values-for-equality/21278>\
**Category:** General Usage\
**Tags:** faq\
**Created:** [February 27, 2019, 8:36pm UTC](https://discourse.julialang.org/t/is-it-safe-to-compare-rounded-float-values-for-equality/21278 "2019-02-27T20:36:13Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 28, 2019, 12:50am UTC](https://discourse.julialang.org/t/is-it-safe-to-compare-rounded-float-values-for-equality/21278/10 "2019-02-28T00:50:40Z")

</div>

Any bucketing of floating-point numbers into more than one bucket will have the property that there are values which only differ in the last bit yet are in different buckets.

---

_[View the full topic](https://discourse.julialang.org/t/is-it-safe-to-compare-rounded-float-values-for-equality/21278)._
