34 #ifdef __cpp_lib_clamp
52 template<
typename dtype>
53 dtype
clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
57 #ifdef __cpp_lib_clamp
58 const auto comparitor = [](dtype lhs, dtype rhs) noexcept ->
bool
63 return std::clamp(inValue, inMinValue, inMaxValue, comparitor);
65 if (inValue < inMinValue)
69 else if (inValue > inMaxValue)
90 template<
typename dtype>
93 return inArray.
clip(inMinValue, inMaxValue);
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:50
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
NdArray< dtype > clip(value_type inMin, value_type inMax) const
Definition: NdArrayCore.hpp:2438
Definition: Coordinate.hpp:45
dtype clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
Definition: clip.hpp:53