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

◆ lpart

kyosu::lpart = {}
inlineconstexpr

Extracts the l (fifth) part of a value.

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr auto& lpart(T& z) noexcept;
template<kyosu::concepts::cayley_dickson T> constexpr auto lpart(T const& z) noexcept;
template<eve::floating_ordered_value T> constexpr T lpart(T const& z) noexcept;
}
constexpr tags::callable_lpart lpart
Extracts the l (fifth) part of a value.
Definition: lpart.hpp:80
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • z: Original value.

Return value

Returns the fifth part of its argument.

For up to quaterion inputs, the call always returns 0.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::lpart;
std::cout << "Real: ";
float f = 72.9f;
std::cout << f << " -> " << lpart(f) << "\n";
std::cout << "Complex: ";
auto z = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << z << " -> " << lpart(z) << "\n";
std::cout << "Quaternion: ";
auto q = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << q << " -> " << lpart(q) << " => ";
std::cout << "octonion: ";
auto o = kyosu::octonion_t<double>(1.,2.,3.,4.,11.,12.,13.,14.);
std::cout << o << " -> " << lpart(o) << " => ";
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
as_cayley_dickson_n_t< 8, T > octonion_t
Type alias for octonion numbers.
Definition: octonion.hpp:26