Skip to content

Commit

Permalink
jpart kpart
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed Sep 8, 2023
1 parent d06bdbf commit 881883c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion include/kyosu/types/cayley_dickson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ namespace kyosu
if constexpr(T::minimum_valid_index == T::maximum_valid_index)
{
if constexpr(sz > T::minimum_valid_index) return get<T::minimum_valid_index>(EVE_FWD(c));
else return eve::underlying_type_t<std::remove_cvref_t<C>>{0};
else return as_real_t<std::remove_cvref_t<C>>{0};
//return eve::underlying_type_t<std::remove_cvref_t<C>>{0};
}
else
{
Expand Down
16 changes: 8 additions & 8 deletions test/unit/function/jpart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ TTS_CASE_WITH ( "Check kyosu::jpart over real"
TTS_EQUAL(kyosu::jpart(data), eve::zero(eve::as(data)));
};

// TTS_CASE_WITH ( "Check kyosu::jpart over complex"
// , kyosu::real_types
// , tts::generate(tts::between(-10,10), tts::between(-10,10))
// )
// (auto r, auto i)
// {
// TTS_EQUAL(kyosu::jpart(kyosu::to_complex(r,i)), eve::zero(eve::as(r)));
// };
TTS_CASE_WITH ( "Check kyosu::jpart over complex"
, kyosu::real_types
, tts::generate(tts::between(-10,10), tts::between(-10,10))
)
(auto r, auto i)
{
TTS_EQUAL(kyosu::jpart(kyosu::to_complex(r,i)), eve::zero(eve::as(r)));
};

TTS_CASE_WITH ( "Check kyosu::jpart over quaternion"
, kyosu::real_types
Expand Down
16 changes: 8 additions & 8 deletions test/unit/function/kpart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ TTS_CASE_WITH ( "Check kyosu::kpart over real"
TTS_EQUAL(kyosu::kpart(data), eve::zero(eve::as(data)));
};

// TTS_CASE_WITH ( "Check kyosu::kpart over complex"
// , kyosu::real_types
// , tts::generate(tts::between(-10,10), tts::between(-10,10))
// )
// (auto r, auto i)
// {
// TTS_EQUAL(kyosu::kpart(kyosu::to_complex(r,i)), eve::zero(eve::as(r)));
// };
TTS_CASE_WITH ( "Check kyosu::kpart over complex"
, kyosu::real_types
, tts::generate(tts::between(-10,10), tts::between(-10,10))
)
(auto r, auto i)
{
TTS_EQUAL(kyosu::kpart(kyosu::to_complex(r,i)), eve::zero(eve::as(r)));
};

TTS_CASE_WITH ( "Check kyosu::kpart over quaternion"
, kyosu::real_types
Expand Down

0 comments on commit 881883c

Please sign in to comment.