coord/ops: add a modulos function
This commit is contained in:
parent
9a8679c733
commit
b8af3d0d9e
@ -878,11 +878,33 @@ namespace cruft {
|
||||
std::cend (k),
|
||||
std::begin (k),
|
||||
[t] (auto v) { return mod (v, t);
|
||||
});
|
||||
});
|
||||
|
||||
return k;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <
|
||||
typename A,
|
||||
typename B,
|
||||
typename = std::enable_if_t<
|
||||
is_coord_v<std::decay_t<A>> && is_coord_v<std::decay_t<B>>
|
||||
>
|
||||
>
|
||||
constexpr auto
|
||||
mod (A &&a, B &&b)
|
||||
{
|
||||
return arithmetic<
|
||||
std::decay_t<A>,
|
||||
std::decay_t<B>
|
||||
>::template eval (
|
||||
std::modulus{},
|
||||
std::forward<A> (a),
|
||||
std::forward<B> (b)
|
||||
);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// trigonometric functions
|
||||
template <
|
||||
|
Loading…
Reference in New Issue
Block a user