Returns elementwise true if it has both an infinite AND a NaN part. This is meant to represent a quantity with infinite magnitude, but undetermined complex phase. This is always false for real entries.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using eve::as;
using e_t = float;
using wc_t = eve::wide<c_t, eve::fixed<4>>;
using wq_t = eve::wide<q_t, eve::fixed<4>>;
e_t nan = eve::nan(as<e_t>());
e_t inf = eve::inf(as<e_t>());
e_t zer = eve::zero(as<e_t>());
std::cout << "Complex: \n";
c_t c(3.5f,-2.9f);
c_t d(inf, nan);
wc_t wc = wc_t(c, zer, ccinf, d);
std::cout << "Quaternion: \n";
q_t q(3.5f,-2.9f, 2.1f, 3.2f);
q_t r(3.5f, nan, 6.0f, inf);
wq_t wq = wq_t(q, nan, qcinf, r);
std::cout <<
"kyosu::abs(wq) "<<
kyosu::abs(wq) << std::endl;
std::cout <<
"kyosu::arg(wq) "<<
kyosu::arg(wq) <<std::endl;
return 0;
}
constexpr auto cinf
Computes the complex-infinite defined as in the chosen type.
Definition: cinf.hpp:77
constexpr auto is_not_cinf
test if the parameter is a not cinf.
Definition: is_not_cinf.hpp:67
constexpr auto arg
argument.
Definition: arg.hpp:70
constexpr auto complex
Constructs a kyosu::complex_t instance.
Definition: to_complex.hpp:75
constexpr auto quaternion
Constructs a kyosu::quaternion_t instance.
Definition: to_quaternion.hpp:83
constexpr auto abs
Computes the absolute value of the parameter.
Definition: abs.hpp:78
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:24
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27