diff --git a/dace/runtime/include/dace/math.h b/dace/runtime/include/dace/math.h index 747be8bf93..61c329ced3 100644 --- a/dace/runtime/include/dace/math.h +++ b/dace/runtime/include/dace/math.h @@ -589,6 +589,22 @@ namespace dace return result; } + + template< + typename T, + typename U, + typename = std::enable_if_t<(std::is_integral::value && std::is_signed::value)> + > + DACE_CONSTEXPR DACE_HDFI T ipow(const T& a, const U b) + { + if(b < 0) { + return T(0); + }; + using UnsignedU = std::make_unsigned_t; + return ipow(a, UnsignedU{b}); + } + + template::value>::type* = nullptr> DACE_CONSTEXPR DACE_HDFI T ifloor(const T& a) {