Extracts the imaginary part of a value.
Returns the second part of its argument.
For real inputs, the call returns 0.
For complex inputs it is the imaginary part.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
std::cout << "Real: ";
float f = 72.9f;
std::cout << f <<
" -> " <<
ipart(f) <<
"\n";
std::cout << "Complex: ";
std::cout << z <<
" -> " <<
ipart(z) <<
" => ";
std::cout << z << "\n";
std::cout << "Quaternion: ";
std::cout << q <<
" -> " <<
ipart(q) <<
" => ";
std::cout << q << "\n";
std::cout << "SIMD: ";
std::cout << wz <<
" -> " <<
ipart(wz) <<
" => ";
ipart(wz) = eve::wide<double, eve::fixed<2>>{13.37,63.24};
std::cout << wz << "\n";
return 0;
}
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