MCKL
Monte Carlo Kernel Library
Functions
Rounding functions

Functions

template<typename T >
void mckl::ceil (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute \(y_i = \lceil a_i \rceil\). More...
 
template<typename T >
void mckl::floor (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute \(y_i = \lfloor a_i \rfloor\). More...
 
template<typename T >
void mckl::modf (std::size_t n, const T *a, T *y, T *z)
 For \(i=1,\ldots,n\), compute the integeral and fraction parts. More...
 
template<typename T >
void mckl::nearbyint (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute the nearest integers, using the current rounding mode. More...
 
template<typename T >
void mckl::rint (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute the nearest integers, using the current rounding mode. More...
 
template<typename T >
void mckl::round (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute the nearest integers, rounding away from zero. More...
 
template<typename T >
void mckl::trunc (std::size_t n, const T *a, T *y)
 For \(i=1,\ldots,n\), compute \(y_i = \mathrm{sgn}(a_i)\lfloor|a_i|\rfloor\). More...
 

Detailed Description

Function Documentation

◆ ceil()

template<typename T >
void mckl::ceil ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute \(y_i = \lceil a_i \rceil\).

Definition at line 1405 of file vmf.hpp.

◆ floor()

template<typename T >
void mckl::floor ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute \(y_i = \lfloor a_i \rfloor\).

Definition at line 1402 of file vmf.hpp.

◆ modf()

template<typename T >
void mckl::modf ( std::size_t  n,
const T *  a,
T *  y,
T *  z 
)
inline

For \(i=1,\ldots,n\), compute the integeral and fraction parts.

Definition at line 1425 of file vmf.hpp.

◆ nearbyint()

template<typename T >
void mckl::nearbyint ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute the nearest integers, using the current rounding mode.

Definition at line 1417 of file vmf.hpp.

◆ rint()

template<typename T >
void mckl::rint ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute the nearest integers, using the current rounding mode.

Definition at line 1421 of file vmf.hpp.

◆ round()

template<typename T >
void mckl::round ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute the nearest integers, rounding away from zero.

Definition at line 1413 of file vmf.hpp.

◆ trunc()

template<typename T >
void mckl::trunc ( std::size_t  n,
const T *  a,
T *  y 
)
inline

For \(i=1,\ldots,n\), compute \(y_i = \mathrm{sgn}(a_i)\lfloor|a_i|\rfloor\).

Definition at line 1409 of file vmf.hpp.