ATLAS Offline Software
Loading...
Searching...
No Matches
FloatingPointHelpers::ConversionHelper< FLarge, FSmall > Struct Template Reference

#include <FPHelpers.h>

Collaboration diagram for FloatingPointHelpers::ConversionHelper< FLarge, FSmall >:

Static Public Member Functions

template<class T>
static constexpr T down_convert (const T pattern, const RoundingModes rt=RoundingModes::Default)
template<class T>
static constexpr T up_convert (const T pattern, const RoundingModes rt=RoundingModes::Default)

Detailed Description

template<class FLarge, class FSmall>
struct FloatingPointHelpers::ConversionHelper< FLarge, FSmall >

Definition at line 707 of file FPHelpers.h.

Member Function Documentation

◆ down_convert()

template<class FLarge, class FSmall>
template<class T>
constexpr T FloatingPointHelpers::ConversionHelper< FLarge, FSmall >::down_convert ( const T pattern,
const RoundingModes rt = RoundingModes::Default )
inlinestaticconstexpr

Definition at line 714 of file FPHelpers.h.

715 {
716 using FDest = FSmall;
717 using FSource = FLarge;
718 using namespace OperatorsHelper;
719
721
724
726
729 //If the number is clamped to infinity, we must delete the mantissa
730 //so we don't get a NaN!
731 const bool denormal = exponent <= delta_exponents;
733
735
738
743 //In case total_mantissa_shift == 0, this is 0 too.
744
746
749
751 //The last part is so that NaN get truncated instead of rounded.
752
754
756
758
759 }
#define min(a, b)
Definition cfImp.cxx:40

◆ up_convert()

template<class FLarge, class FSmall>
template<class T>
constexpr T FloatingPointHelpers::ConversionHelper< FLarge, FSmall >::up_convert ( const T pattern,
const RoundingModes rt = RoundingModes::Default )
inlinestaticconstexpr

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