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