NumCpp  2.1.0
A C++ implementation of the Python Numpy library
round.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/Core/Types.hpp"
32 #include "NumCpp/NdArray.hpp"
33 
34 namespace nc
35 {
36  //============================================================================
37  // Method Description:
46  template<typename dtype>
47  dtype round(dtype inValue, uint8 inDecimals = 0)
48  {
49  NdArray<dtype> input = { inValue };
50  return input.round(inDecimals).item();
51  }
52 
53  //============================================================================
54  // Method Description:
63  template<typename dtype>
64  NdArray<dtype> round(const NdArray<dtype>& inArray, uint8 inDecimals = 0)
65  {
66  return inArray.round(inDecimals);
67  }
68 } // namespace nc
nc::NdArray::item
value_type item() const
Definition: NdArrayCore.hpp:2958
nc::NdArray::round
NdArray< dtype > round(uint8 inNumDecimals=0) const
Definition: NdArrayCore.hpp:4274
nc::uint8
std::uint8_t uint8
Definition: Types.hpp:43
nc::NdArray< dtype >
NdArray.hpp
nc
Definition: Coordinate.hpp:45
nc::round
dtype round(dtype inValue, uint8 inDecimals=0)
Definition: round.hpp:47
Types.hpp