kyosu v0.1.0
Complex Without Complexes
 
Loading...
Searching...
No Matches

◆ is_not_infinite

kyosu::is_not_infinite = {}
inlineconstexpr

test if the parameter is not infinite.

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr auto is_not_infinite(T z) noexcept;
template<eve::floating_ordered_value T> constexpr auto is_not_infinite(T z) noexcept;
}
constexpr tags::callable_is_not_infinite is_not_infinite
test if the parameter is not infinite.
Definition: is_not_infinite.hpp:72
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • z: Value to process.

Return value

Returns elementwise false is any component of the element is infinite .

Example

#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_infinite(e) << "\n";
std::cout << we << " -> " << is_not_infinite(we) << "\n";
std::cout << is_not_infinite(c_t(e))<< "\n";
std::cout << is_not_infinite(q_t(e))<< "\n";
std::cout << is_not_infinite(kyosu::complex(we))<< "\n";
std::cout << is_not_infinite(kyosu::quaternion(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_infinite(c) << "\n";
std::cout << wc << " -> " << is_not_infinite(wc) << "\n";
std::cout << is_not_infinite(kyosu::complex(wc))<< "\n";;
std::cout << is_not_infinite(kyosu::quaternion(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_infinite(q) << "\n";
std::cout << wq << " -> " << is_not_infinite(wq) << "\n";
return 0;
}
constexpr tags::callable_complex complex
Constructs a kyosu::complex.
Definition: to_complex.hpp:70
constexpr tags::callable_quaternion quaternion
Constructs a kyosu::quaternion.
Definition: to_quaternion.hpp:72
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27