Skip to content

Commit f9244ba

Browse files
authored
Merge pull request #1278 from aprokop/fix_hardcoded_floats
2 parents 32d5b43 + 8212fcc commit f9244ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/geometry/algorithms/ArborX_Distance.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ struct distance<PointTag, SphereTag, Point, Sphere>
101101
KOKKOS_FUNCTION static auto apply(Point const &point, Sphere const &sphere)
102102
{
103103
using Kokkos::max;
104+
using Coordinate = GeometryTraits::coordinate_type_t<Sphere>;
104105
return max(Details::distance(point, sphere.centroid()) - sphere.radius(),
105-
0.f);
106+
(Coordinate)0);
106107
}
107108
};
108109

@@ -251,9 +252,10 @@ struct distance<SphereTag, BoxTag, Sphere, Box>
251252
KOKKOS_FUNCTION static auto apply(Sphere const &sphere, Box const &box)
252253
{
253254
using Kokkos::max;
255+
using Coordinate = GeometryTraits::coordinate_type_t<Sphere>;
254256

255257
auto distance_center_box = Details::distance(sphere.centroid(), box);
256-
return max(distance_center_box - sphere.radius(), 0.f);
258+
return max(distance_center_box - sphere.radius(), (Coordinate)0);
257259
}
258260
};
259261

0 commit comments

Comments
 (0)