NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
fmod.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31#include <string>
32
36#include "NumCpp/NdArray.hpp"
37
38namespace nc
39{
40 //============================================================================
41 // Method Description:
51 template<typename dtype, std::enable_if_t<std::is_integral_v<dtype>, int> = 0>
52 dtype fmod(dtype inValue1, dtype inValue2) noexcept
53 {
54 return inValue1 % inValue2;
55 }
56
57 //============================================================================
58 // Method Description:
68 template<typename dtype, std::enable_if_t<std::is_floating_point_v<dtype>, int> = 0>
69 dtype fmod(dtype inValue1, dtype inValue2) noexcept
70 {
71 return std::fmod(inValue1, inValue2);
72 }
73
74 //============================================================================
75 // Method Description:
85 template<typename dtype>
86 NdArray<dtype> fmod(const NdArray<dtype>& inArray1, const NdArray<dtype>& inArray2)
87 {
88 return inArray1 % inArray2;
89 }
90} // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
Definition: Cartesian.hpp:40
NdArray< dtype > fmod(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: fmod.hpp:86
dtype fmod(dtype inValue1, dtype inValue2) noexcept
Definition: fmod.hpp:52