CMS 3D CMS Logo

Functions
cms_rounding Namespace Reference

Functions

template<class valType >
constexpr valType roundIfNear0 (valType value, double tolerance=1.e-7)
 
template<class valType >
constexpr valType roundVecIfNear0 (valType value, double tolerance=1.e-7)
 

Function Documentation

◆ roundIfNear0()

template<class valType >
constexpr valType cms_rounding::roundIfNear0 ( valType  value,
double  tolerance = 1.e-7 
)
inline

◆ roundVecIfNear0()

template<class valType >
constexpr valType cms_rounding::roundVecIfNear0 ( valType  value,
double  tolerance = 1.e-7 
)
inline

Definition at line 18 of file Rounding.h.

References roundIfNear0(), and tolerance.

Referenced by DTGeometryTest::analyze().

18  {
19  auto xVal{roundIfNear0(value.x(), tolerance)};
20  auto yVal{roundIfNear0(value.y(), tolerance)};
21  auto zVal{roundIfNear0(value.z(), tolerance)};
22  return (valType{xVal, yVal, zVal});
23  }
const double tolerance
Definition: value.py:1
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11