TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsFloatUtils.h File Reference

Some utilities on floating point types. More...

Classes

struct  ts::ieee_float< storage_bits, exponent_bits, mantissa_bits >
 Definition of an IEEE floating point type with a given represenation. More...
 

Namespaces

namespace  ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Typedefs

using ts::ieee_float128_t = typename ieee_float< 128, 15, 112 >::type
 128-bit IEEE floating point type.
 
using ts::ieee_float32_t = typename ieee_float< 32, 8, 23 >::type
 32-bit IEEE floating point type.
 
using ts::ieee_float64_t = typename ieee_float< 64, 11, 52 >::type
 64-bit IEEE floating point type.
 
using ts::ieee_float80_t = typename ieee_float< 80, 15, 64 >::type
 80-bit IEEE floating point type.
 

Functions

template<typename T >
requires std::floating_point<T>
bool ts::equal_float (T a, T b, T epsilon=2 *std::numeric_limits< T >::epsilon())
 This template function compares two floating point values for approximated equality.
 
ieee_float32_t ts::GetFloat32 (const void *p)
 Function getting a 32-bit IEEE float from serialized data in big endian representation.
 
ieee_float32_t ts::GetFloat32BE (const void *p)
 Function getting a 32-bit IEEE float from serialized data in big endian representation.
 
ieee_float32_t ts::GetFloat32LE (const void *p)
 Function getting a 32-bit IEEE float from serialized data in little endian representation.
 
ieee_float64_t ts::GetFloat64 (const void *p)
 Function getting a 64-bit IEEE float from serialized data in big endian representation.
 
ieee_float64_t ts::GetFloat64BE (const void *p)
 Function getting a 64-bit IEEE float from serialized data in big endian representation.
 
ieee_float64_t ts::GetFloat64LE (const void *p)
 Function getting a 64-bit IEEE float from serialized data in little endian representation.
 
template<typename T , int storage_bits, int exponent_bits, int mantissa_bits>
requires std::floating_point<T>
constexpr bool ts::match_ieee_float ()
 This template function checks if a floating point type matches a given IEEE represenation.
 
void ts::PutFloat32 (void *p, ieee_float32_t f)
 Function serializing a 32-bit IEEE float data in big endian representation.
 
void ts::PutFloat32BE (void *p, ieee_float32_t f)
 Function serializing a 32-bit IEEE float data in big endian representation.
 
void ts::PutFloat32LE (void *p, ieee_float32_t f)
 Function serializing a 32-bit IEEE float data in little endian representation.
 
void ts::PutFloat64 (void *p, ieee_float64_t f)
 Function serializing a 64-bit IEEE float data in big endian representation.
 
void ts::PutFloat64BE (void *p, ieee_float64_t f)
 Function serializing a 64-bit IEEE float data in big endian representation.
 
void ts::PutFloat64LE (void *p, ieee_float64_t f)
 Function serializing a 64-bit IEEE float data in little endian representation.
 

Detailed Description

Some utilities on floating point types.