]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/halfspace.h
Always explicitly construct values of type T
[libs/math.git] / source / geometry / halfspace.h
index 5fdea34c885eaf2dbf17296b07d4677984589fef..f671629e56194b0a93a00220c5ef17ef0c6ad0f7 100644 (file)
@@ -33,7 +33,7 @@ public:
 template<typename T, unsigned D>
 inline HalfSpace<T, D>::HalfSpace()
 {
-       normal[0] = 1;
+       normal[0] = T(1);
 }
 
 template<typename T, unsigned D>
@@ -57,7 +57,7 @@ inline BoundingBox<T, D> HalfSpace<T, D>::get_axis_aligned_bounding_box() const
 template<typename T, unsigned D>
 inline bool HalfSpace<T, D>::contains(const LinAl::Vector<T, D> &point) const
 {
-       return inner_product(point, normal)<=0;
+       return inner_product(point, normal)<=T(0);
 }
 
 template<typename T, unsigned D>