11inline int sign(
double number)
15 }
else if (
greater(0.0, number)) {
22template <
int iexp,
typename T>
25 static_assert(iexp >= 0,
"Exponent must be an integer greater or equal to zero.");
28 return static_cast<T
>(1.);
31 return ((iexp % 2 == 1) ? x * pow_int<iexp / 2>(x * x) : pow_int<iexp / 2>(x * x));
constexpr T pow_int(const T x)
Computes the power of a given number by an integral exponent given at compile time,...
int sign(double number)
Return the sign, one of {-1, 0, 1}.
std::enable_if< std::is_arithmetic< Scalar >::value, bool >::type greater(Scalar A, Scalar B, Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Main namespace of the precice library.