sigma  1.0.0
Loading...
Searching...
No Matches
numeric.hpp
Go to the documentation of this file.
1#pragma once
2#include <cmath>
3#include <type_traits>
4
8
9namespace sigma::detail {
10
26template<typename U>
27bool is_integer_exponent(const U& exp) {
28 using clean_u_t = std::decay_t<U>;
29 if constexpr(std::is_floating_point_v<clean_u_t>) {
30 clean_u_t exp_int;
31 return std::modf(exp, &exp_int) == U(0);
32 } else {
33 return true;
34 }
35}
36
37} // namespace sigma::detail
Affine< T > exp(const Affine< T > &a)
Calculate the exponential of an affine form.
Definition exponents.ipp:31
bool is_integer_exponent(const U &exp)
True if exp has no fractional part.
Definition numeric.hpp:27