modm API documentation
modm::ArithmeticTraits< T > Struct Template Reference

#include <modm/math/utils/arithmetic_traits.hpp>

Static Public Attributes

static constexpr bool isInteger
 
static constexpr unsigned char decimalDigits
 

Detailed Description

template<typename T>
struct modm::ArithmeticTraits< T >

Arithmetic Traits

Previously, some of the functionalities of <type_traits> and <limits> were implemented here, when they were not yet available in the C++ standard library. Only isInteger and decimalDigits are left, for all others please use the C++ standard library in the future.

Values provided by these traits

  • isInteger is this a integer type
  • decimalDigits count of digits to display this type in decimal

Usage

Member Data Documentation

template<typename T >
constexpr unsigned char modm::ArithmeticTraits< T >::decimalDigits
staticconstexpr
Initial value:
std::ceil(std::numeric_limits<T>::digits * log10(2)) + (std::is_signed_v<T> ? 1 : 0)
template<typename T >
constexpr bool modm::ArithmeticTraits< T >::isInteger
staticconstexpr
Initial value:
std::is_integral_v<T>
&& !std::is_same_v<std::decay_t<T>, bool>

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