frexpc

Contents

frexpc#

Return the normalized fraction and exponent part of a complex floating point number

Added in version 0.9.0.

template<typename OpA>
__MATX_INLINE__ auto matx::frexpc(const OpA &a)#

Examples#

// Input data
auto tiv0  = make_tensor<TestType>({10});

// Output fractional/integer parts
auto tofrac_real = make_tensor<typename TestType::value_type>({10});
auto tofrac_imag = make_tensor<typename TestType::value_type>({10});
auto toint_real  = make_tensor<int>({10});
auto toint_imag  = make_tensor<int>({10});

// Create operators representing fractional and integer
for (index_t i = 0; i < tiv0.Size(0); i++) {
  using InnerType = typename TestType::value_type;
  const double xr = (static_cast<double>(i) - 5.0) * 0.25;
  const double xi = (static_cast<double>(i) - 3.0) * 0.5;
  tiv0(i) = TestType(static_cast<InnerType>(xr),
                     static_cast<InnerType>(xi));
}
exec.sync();
const auto [ofrac_real, oint_real, ofrac_imag, oint_imag] = frexpc(tiv0);

(tofrac_real = ofrac_real).run(exec);
(toint_real = oint_real).run(exec);
(tofrac_imag = ofrac_imag).run(exec);
(toint_imag = oint_imag).run(exec);