Skip to content
Snippets Groups Projects
Commit 56e7fbc3 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Pow(x, 1/3) -> cbrt(x)

gcc will now accept negative values
parent 1bc47d48
No related branches found
No related tags found
No related merge requests found
Pipeline #134906 passed
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <math.h>
namespace allowed_op_funcs namespace allowed_op_funcs
{ {
...@@ -230,7 +231,7 @@ inline void cbrt( ...@@ -230,7 +231,7 @@ inline void cbrt(
const int size, const double* in_0, const double alpha, const double a, double* out) const int size, const double* in_0, const double alpha, const double a, double* out)
{ {
std::transform( std::transform(
in_0, in_0 + size, out, [&](double i0) { return std::pow(alpha * i0 + a, 1.0 / 3.0); }); in_0, in_0 + size, out, [&](double i0) { return std::cbrt(alpha * i0 + a); });
} }
/** /**
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment