49 template<
typename dtype>
54 if (inArray1.
size() != inArray2.
size())
62 for (
auto i = 0u; i < inArray1.
size(); ++i)
64 if constexpr (std::is_floating_point_v<dtype>)
66 div[i] = std::floor(inArray1[i] / inArray2[i]);
67 mod[i] = std::fmod(inArray1[i], inArray2[i]);
71 div[i] = inArray1[i] / inArray2[i];
72 mod[i] = inArray1[i] % inArray2[i];
76 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:135
size_type size() const noexcept
Definition NdArrayCore.hpp:4600
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4587
Definition Cartesian.hpp:39
std::pair< NdArray< dtype >, NdArray< dtype > > divmod(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition divmod.hpp:50
NdArray< dtype > mod(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition mod.hpp:46