51 template<
typename dtype>
56 if (inArray1.
size() != inArray2.
size())
64 for (
auto i = 0u; i < inArray1.
size(); ++i)
66 if constexpr (std::is_floating_point_v<dtype>)
68 div[i] =
std::floor(inArray1[i] / inArray2[i]);
73 div[i] = inArray1[i] / inArray2[i];
74 mod[i] = inArray1[i] % inArray2[i];
78 return std::make_pair(div,
mod);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
size_type size() const noexcept
Definition: NdArrayCore.hpp:4604
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4591
Definition: Cartesian.hpp:40
dtype fmod(dtype inValue1, dtype inValue2) noexcept
Definition: fmod.hpp:52
dtype floor(dtype inValue) noexcept
Definition: floor.hpp:48
std::pair< NdArray< dtype >, NdArray< dtype > > divmod(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: divmod.hpp:52
NdArray< dtype > mod(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: mod.hpp:46