Computes the the kth nth root of the argument.
#include <eve/wide.hpp>
#include <iostream>
#include <kyosu/kyosu.hpp>
int main()
{
using wi_t = eve::wide<unsigned int, eve::fixed<4>>;
using wf_t = eve::wide<float, eve::fixed<4>>;
wi_t wn = eve::iota(eve::as<wi_t>()) + 1;
wf_t wf{5.0f, 2.3f, 1.2f, 0.0f};
std::cout << "wn " << wn << std::endl;
std::cout << "wf " << wf << std::endl;
std::cout <<
"kyosu::nthroot(16.0, wn) " <<
kyosu::nthroot(16.0, wn) << std::endl;
std::cout <<
"kyosu::nthroot(16.0, 4, wn) " <<
kyosu::nthroot(16.0, 4, wn) << std::endl;
std::cout <<
"kyosu::nthroot(16.0, -2) " <<
kyosu::nthroot(16.0, -2) << std::endl;
std::cout <<
"kyosu::nthroot(wf, wn) " <<
kyosu::nthroot(wf, wn) << std::endl;
std::cout <<
"kyosu::nthroot(wf, wn, 3) " <<
kyosu::nthroot(wf, wn, 3) << std::endl;
return 0;
}
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition complex.hpp:27