test if the parameter is not a Nan.
Returns elementwise false is any component of the element is a Nan.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using eve::as;
using e_t = float;
using we_t = eve::wide<e_t, eve::fixed<4>>;
using wc_t = eve::wide<c_t, eve::fixed<4>>;
using wq_t = eve::wide<q_t, eve::fixed<4>>;
std::cout << "Real: \n";
e_t e(2.9f);
e_t nan = eve::nan(as(e));
e_t inf = eve::inf(as(e));
e_t zer = eve::zero(as(e));
we_t we = we_t(e, zer, nan, inf);
std::cout << e <<
" -> " <<
is_not_nan(e) <<
"\n";
std::cout << we <<
" -> " <<
is_not_nan(we) <<
"\n";
std::cout << "Complex: \n";
c_t c(3.5f,-2.9f);
c_t d(0.0f, inf);
wc_t wc = wc_t(c, zer, nan, d);
std::cout << c <<
" -> " <<
is_not_nan(c) <<
"\n";
std::cout << wc <<
" -> " <<
is_not_nan(wc) <<
"\n";
std::cout << "Quaternion: \n";
q_t q(3.5f,-2.9f, 2.1f, 3.2f);
q_t r(3.5f, nan, inf, zer);
wq_t wq = wq_t(q, zer, nan, r);
std::cout << q <<
" -> " <<
is_not_nan(q) <<
"\n";
std::cout << wq <<
" -> " <<
is_not_nan(wq) <<
"\n";
return 0;
}
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
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