Half-Integers. More...
#include <half_int.h>
Public Member Functions | |
HalfInteger ()=default | |
Default ctor. More... | |
template<typename Source , typename std::enable_if_t< std::is_integral_v< Source > &&is_number_v< Source >, int > = 0> | |
HalfInteger (Source const b) | |
Conversion from integers, need to check for overflow. More... | |
template<typename Source , typename std::enable_if_t<(!std::is_integral_v< Source >) &&is_number_v< Source >, int > = 0> | |
HalfInteger (Source const b) | |
Conversion from floating point numbers needs rounding. More... | |
template<typename Source , typename std::enable_if_t< is_number_v< Source >, int > = 0> | |
HalfInteger (Source const b, bool) | |
Conversion from a source without multiplication, use if you have the SYTEN_SRDEF_TYPEd value already. More... | |
bool | isInteger () const |
Returns true if this represents an integer (and not a half-int) More... | |
operator Base () const | |
Conversion to the base integer only explicitly. More... | |
template<typename Float , typename std::enable_if< std::is_floating_point< Float >::value &&!std::is_same_v< SYTEN_SRDEF_TYPE, Float >, int >::type = 0> | |
operator Float () const | |
Conversion to any other floating point value only explicitly. More... | |
operator SYTEN_SRDEF_TYPE () const | |
Conversion to SYTEN_SRDEF_TYPE allowed implicitly. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int in_version) |
Boost serialisation. More... | |
Static Public Member Functions | |
static constexpr double | max () |
Returns the largest representable value as a double . More... | |
static constexpr double | min () |
Returns the smallest representable value as a double . More... | |
Public Attributes | |
Base | value = 0 |
The base value, divide this by 2 to get the actual value. More... | |
Static Public Attributes | |
static constexpr unsigned int | version = 1 |
Boost serialisation version. More... | |
Half-Integers.