pow_helper< Exponent, ExpIsInteger > Struct Template Reference

Static Public Member Functions

static bool is_integer_impl (const Exponent &exp)
 
static bool is_odd_impl (const Exponent &exp)
 

Member Function Documentation

◆ is_integer_impl()

template<typename Exponent , bool ExpIsInteger = NumTraits<Exponent>::IsInteger>
static bool pow_helper< Exponent, ExpIsInteger >::is_integer_impl ( const Exponent &  exp)
inlinestatic
235 { return (numext::isfinite)(exp) && exp == numext::floor(exp); }
#define isfinite(X)
Definition: main.h:111
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 floor(const bfloat16 &a)
Definition: BFloat16.h:643
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615

References Eigen::bfloat16_impl::exp(), Eigen::bfloat16_impl::floor(), and isfinite.

Referenced by is_integer().

◆ is_odd_impl()

template<typename Exponent , bool ExpIsInteger = NumTraits<Exponent>::IsInteger>
static bool pow_helper< Exponent, ExpIsInteger >::is_odd_impl ( const Exponent &  exp)
inlinestatic
236  {
237  Exponent exp_div_2 = exp / Exponent(2);
238  Exponent floor_exp_div_2 = numext::floor(exp_div_2);
239  return exp_div_2 != floor_exp_div_2;
240  }

References Eigen::bfloat16_impl::exp(), and Eigen::bfloat16_impl::floor().

Referenced by is_odd().


The documentation for this struct was generated from the following file: