34 #ifdef __cpp_lib_clamp
51 template<
typename dtype>
52 dtype
clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
56 #ifdef __cpp_lib_clamp
57 const auto comparitor = [](dtype lhs, dtype rhs) noexcept ->
bool
62 return std::clamp(inValue, inMinValue, inMaxValue, comparitor);
64 if (inValue < inMinValue)
68 else if (inValue > inMaxValue)
88 template<
typename dtype>
91 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:2293
Definition: Coordinate.hpp:45
dtype clip(dtype inValue, dtype inMinValue, dtype inMaxValue)
Definition: clip.hpp:52