NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
round.hpp
Go to the documentation of this file.
1
#pragma once
29
30
#include "
NumCpp/Core/Types.hpp
"
31
#include "
NumCpp/NdArray.hpp
"
32
33
namespace
nc
34
{
35
//============================================================================
36
// Method Description:
45
template
<
typename
dtype>
46
dtype
round
(dtype inValue,
uint8
inDecimals = 0)
47
{
48
NdArray<dtype>
input = { inValue };
49
return
input.
round
(inDecimals).
item
();
50
}
51
52
//============================================================================
53
// Method Description:
62
template
<
typename
dtype>
63
NdArray<dtype>
round
(
const
NdArray<dtype>
& inArray,
uint8
inDecimals = 0)
64
{
65
return
inArray.
round
(inDecimals);
66
}
67
}
// namespace nc
nc::NdArray::item
value_type item() const
Definition:
NdArrayCore.hpp:2975
nc::NdArray::round
NdArray< dtype > round(uint8 inNumDecimals=0) const
Definition:
NdArrayCore.hpp:4318
nc::uint8
std::uint8_t uint8
Definition:
Types.hpp:42
nc::NdArray< dtype >
NdArray.hpp
nc
Definition:
Coordinate.hpp:44
nc::round
dtype round(dtype inValue, uint8 inDecimals=0)
Definition:
round.hpp:46
Types.hpp
include
NumCpp
Functions
round.hpp
Generated by
1.8.17