Boost logo

Geometry :

Subject: Re: [geometry] warning: comparing floating point with == or != is unsafe
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-06-06 22:46:50


Mateusz Loskot wrote:
> On 7 June 2013 01:36, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]> wrote:
>>
>> Ah, I've forgotten to handle this after porting it from the old version.
>> Thanks for digging this up. Yes, there should probably be comparison with
>> std::numeric_limits<coordinate_type>::epsilon().
>
> You may try GCC/clang with -Wfloat-equal, there is a few more, but those
> need to be addressed individually, I think.
>
> So, we may discuss unobvious cases.
>

In the Index there are comparisons in:

/boost/geometry/index/detail/rtree/visitors/insert.hpp:70
/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp:326
/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp:189
/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp:93
/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp:112

but they're ok.

And I've detected also the one in:

/boost/geometry/util/math.hpp:54

Regards,
Adam


Geometry list run by mateusz at loskot.net