]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/hypersphere.h
Always explicitly construct values of type T
[libs/math.git] / source / geometry / hypersphere.h
index e2e3102014a1f73a9cfb9411d9b90638c937f851..4df03fed0eb433abb38d6df8e9375fc42f78befe 100644 (file)
@@ -70,7 +70,7 @@ inline unsigned HyperSphere<T, D>::get_intersections(const Ray<T, D> &ray, Surfa
        T mid = -inner_product(ray.get_direction(), ray.get_start());
        LinAl::Vector<T, D> nearest = ray.get_start()+ray.get_direction()*mid;
        T offset_sq = radius*radius-inner_product(nearest, nearest);
-       if(offset_sq<0)
+       if(offset_sq<T(0))
                return 0;
        T offset = sqrt(offset_sq);