Elements  6.2
A C++ base framework for the Euclid Software.
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
Elements::FloatingPoint< RawType > Class Template Reference

#include <Real.h>

Collaboration diagram for Elements::FloatingPoint< RawType >:
Collaboration graph
[legend]

Classes

union  FloatingPointUnion
 

Public Types

using Bits = typename TypeWithSize< sizeof(RawType)>::UInt
 

Public Member Functions

 FloatingPoint (const RawType &x)
 
const Bitsbits () const
 
Bits exponentBits () const
 
Bits fractionBits () const
 
Bits signBit () const
 
bool isNan () const
 
bool AlmostEquals (const FloatingPoint &rhs) const
 

Static Public Member Functions

static RawType ReinterpretBits (const Bits &bits)
 
static RawType Infinity ()
 
static Bits signAndMagnitudeToBiased (const Bits &sam)
 
static Bits distanceBetweenSignAndMagnitudeNumbers (const Bits &sam1, const Bits &sam2)
 

Static Public Attributes

static const std::size_t s_bitcount = 8 * sizeof(RawType)
 
static const std::size_t s_fraction_bitcount = std::numeric_limits<RawType>::digits - 1
 
static const std::size_t s_exponent_bitcount = s_bitcount - 1 - s_fraction_bitcount
 
static const Bits s_sign_bitmask = static_cast<Bits>(1) << (s_bitcount - 1)
 
static const Bits s_fraction_bitmask = ~static_cast<Bits>(0) >> (s_exponent_bitcount + 1)
 
static const Bits s_exponent_bitmask = ~(s_sign_bitmask | s_fraction_bitmask)
 
static const std::size_t m_max_ulps = defaultMaxUlps<RawType>()
 

Private Attributes

FloatingPointUnion m_u
 

Detailed Description

template<typename RawType>
class Elements::FloatingPoint< RawType >

Definition at line 172 of file Real.h.

Member Typedef Documentation

◆ Bits

template<typename RawType >
using Elements::FloatingPoint< RawType >::Bits = typename TypeWithSize<sizeof(RawType)>::UInt

Definition at line 176 of file Real.h.

Constructor & Destructor Documentation

◆ FloatingPoint()

template<typename RawType >
Elements::FloatingPoint< RawType >::FloatingPoint ( const RawType &  x)
inlineexplicit

Definition at line 218 of file Real.h.

Member Function Documentation

◆ AlmostEquals()

template<typename RawType >
bool Elements::FloatingPoint< RawType >::AlmostEquals ( const FloatingPoint< RawType > &  rhs) const
inline

◆ bits()

template<typename RawType >
const Bits& Elements::FloatingPoint< RawType >::bits ( ) const
inline

Definition at line 241 of file Real.h.

◆ distanceBetweenSignAndMagnitudeNumbers()

template<typename RawType >
static Bits Elements::FloatingPoint< RawType >::distanceBetweenSignAndMagnitudeNumbers ( const Bits sam1,
const Bits sam2 
)
inlinestatic

Definition at line 309 of file Real.h.

Referenced by Elements::isEqual().

◆ exponentBits()

template<typename RawType >
Bits Elements::FloatingPoint< RawType >::exponentBits ( ) const
inline

Definition at line 246 of file Real.h.

◆ fractionBits()

template<typename RawType >
Bits Elements::FloatingPoint< RawType >::fractionBits ( ) const
inline

Definition at line 251 of file Real.h.

◆ Infinity()

template<typename RawType >
static RawType Elements::FloatingPoint< RawType >::Infinity ( )
inlinestatic

Definition at line 234 of file Real.h.

◆ isNan()

template<typename RawType >
bool Elements::FloatingPoint< RawType >::isNan ( ) const
inline

Definition at line 261 of file Real.h.

Referenced by Elements::FloatingPoint< RawType >::AlmostEquals().

◆ ReinterpretBits()

template<typename RawType >
static RawType Elements::FloatingPoint< RawType >::ReinterpretBits ( const Bits bits)
inlinestatic

◆ signAndMagnitudeToBiased()

template<typename RawType >
static Bits Elements::FloatingPoint< RawType >::signAndMagnitudeToBiased ( const Bits sam)
inlinestatic

Definition at line 297 of file Real.h.

◆ signBit()

template<typename RawType >
Bits Elements::FloatingPoint< RawType >::signBit ( ) const
inline

Definition at line 256 of file Real.h.

Member Data Documentation

◆ m_max_ulps

template<typename RawType >
const std::size_t Elements::FloatingPoint< RawType >::m_max_ulps = defaultMaxUlps<RawType>()
static

Definition at line 210 of file Real.h.

◆ m_u

template<typename RawType >
FloatingPointUnion Elements::FloatingPoint< RawType >::m_u
private

◆ s_bitcount

template<typename RawType >
const std::size_t Elements::FloatingPoint< RawType >::s_bitcount = 8 * sizeof(RawType)
static

Definition at line 181 of file Real.h.

◆ s_exponent_bitcount

template<typename RawType >
const std::size_t Elements::FloatingPoint< RawType >::s_exponent_bitcount = s_bitcount - 1 - s_fraction_bitcount
static

Definition at line 187 of file Real.h.

◆ s_exponent_bitmask

template<typename RawType >
const Bits Elements::FloatingPoint< RawType >::s_exponent_bitmask = ~(s_sign_bitmask | s_fraction_bitmask)
static

Definition at line 196 of file Real.h.

◆ s_fraction_bitcount

template<typename RawType >
const std::size_t Elements::FloatingPoint< RawType >::s_fraction_bitcount = std::numeric_limits<RawType>::digits - 1
static

Definition at line 184 of file Real.h.

◆ s_fraction_bitmask

template<typename RawType >
const Bits Elements::FloatingPoint< RawType >::s_fraction_bitmask = ~static_cast<Bits>(0) >> (s_exponent_bitcount + 1)
static

Definition at line 193 of file Real.h.

◆ s_sign_bitmask

template<typename RawType >
const Bits Elements::FloatingPoint< RawType >::s_sign_bitmask = static_cast<Bits>(1) << (s_bitcount - 1)
static

Definition at line 190 of file Real.h.


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