Commit d305e418 authored by Lukas Werner's avatar Lukas Werner
Browse files

Attempt to fix float conversion warning

parent 267990ba
Pipeline #6358 failed with stage
in 87 minutes and 21 seconds
......@@ -45,7 +45,7 @@ namespace walberla {
*t = real_t(INFINITY);
return false;
}
real_t root = sqrt(discriminant);
real_t root = real_t(std::sqrt(discriminant));
real_t t0 = (-b - root) / (real_t(2.) * a); // point where the ray enters the sphere
real_t t1 = (-b + root) / (real_t(2.) * a); // point where the ray leaves the sphere
if (t0 < 0 && t1 < 0) {
......
......@@ -38,7 +38,7 @@ void SphereIntersectsTest()
WALBERLA_CHECK(realIsEqual(t, real_t(6)))
// ray tangential
Ray ray2(Vec3(-5,3,3), Vec3(7.5,0,sqrt(real_t(15))/real_t(2)));
Ray ray2(Vec3(-5,3,3), Vec3(7.5,0,real_t(std::sqrt(real_t(15))/real_t(2))));
WALBERLA_CHECK(!intersects(&sp1, &ray2, &t));
// sphere behind ray origin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment