Skip to content

Commit

Permalink
Use std::sqrt() instead of std::pow()
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Mar 11, 2024
1 parent 9ed8e4c commit c577322
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/imath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ inline T iroot(T x)

if (N == 3)
r = (T) std::cbrt((double) x);
else if (N == 4)
r = (T) std::sqrt(std::sqrt((double) x));
else
r = (T) std::pow((double) x, 1.0 / N);

Expand Down

0 comments on commit c577322

Please sign in to comment.