TSDuck Version 3.15-955 (TSDuck - The MPEG Transport Stream Toolkit)
tsIntegerUtils.h File Reference

Some utilities on integers. More...

Namespaces

 ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Functions

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::BoundedAdd (INT a, INT b)
 Perform a bounded addition without overflow. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::BoundedSub (INT a, INT b)
 Perform a bounded subtraction without overflow. More...
 
size_t ts::MaxDecimalWidth (size_t typeSize, size_t digitSeparatorSize=0)
 Compute the maximum width of the decimal representation of an integer type. More...
 
size_t ts::MaxHexaWidth (size_t typeSize, size_t digitSeparatorSize=0)
 Compute the maximum width of the hexadecimal representation of an integer type. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::RoundDown (INT x, INT f)
 Round x down to previous multiple of a factor f. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::RoundUp (INT x, INT f)
 Round x up to next multiple of a factor f. More...
 

Detailed Description

Some utilities on integers.