Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
hydra::detail::nearest_int< N, D > Struct Template Reference

Round to nearest integer at compile time. More...

#include <Utils.h>

Collaboration diagram for hydra::detail::nearest_int< N, D >:

Static Public Attributes

static constexpr int value
 

Detailed Description

template<int N, int D>
struct hydra::detail::nearest_int< N, D >

Round to nearest integer at compile time.

Rounds half integers to the nearest even integer.

Field Documentation

◆ value

template<int N, int D>
constexpr int hydra::detail::nearest_int< N, D >::value
static
Initial value:
= std::ratio_greater<std::ratio<N,D>, std::ratio<0,D>>::value ?
int( sum::num/sum::den) - ( int( sum::num/sum::den) & 1 ) :
int( diff::num/diff::den) + ( int( diff::num/diff::den) & 1 )

The documentation for this struct was generated from the following file: