13 #ifndef eli_util_floating_point_hpp
14 #define eli_util_floating_point_hpp
18 #include "eli/code_eli.hpp"
76 return static_cast<const float_type *
>(
static_cast<const void *
>(pcf));
81 return static_cast<float_type *
>(
static_cast<void *
>(pf));
86 return static_cast<const double_type *
>(
static_cast<const void *
>(pcf));
91 return static_cast<double_type *
>(
static_cast<void *
>(pf));
96 return static_cast<const long_double_type *
>(
static_cast<const void *
>(pcf));
111 ostr << std::hex <<
"0x" << (ft.
i >> sign_shift)
112 <<
" 0x" << (ft.
i & mantissa_mask)
113 <<
" 0x" << ((ft.
i >> exponent_shift) & exponent_mask)
126 ostr << std::hex <<
"0x" << (ft.
i >> sign_shift)
127 <<
" 0x" << (ft.
i & mantissa_mask)
128 <<
" 0x" << ((ft.
i >> exponent_shift) & exponent_mask)
142 ostr << std::hex <<
"0x" << (ft.
i >> sign_shift)
143 <<
" 0x" << (ft.
i & mantissa_mask)
144 <<
" 0x" << ((ft.
i >> exponent_shift) & exponent_mask)
153 ostr << std::hex <<
"0x" << ft.
parts.
sign
155 <<
" 0x" << (ft.
i[0] & mantissa_mask)
156 <<
" 0x" << ((ft.
i[1] >> exponent_shift) & exponent_mask)
163 template<
typename data__>
172 #if defined(__GNUC__) && defined(NDEBUG) && !defined(__clang__) && (__GNUC__==4) && (__GNUC_MINOR__==5)
178 pi=
static_cast<int32_t *
>(
static_cast<void *
>(&fr));
186 #if defined(__GNUC__) && defined(NDEBUG) && !defined(__clang__) && (__GNUC__==4) && (__GNUC_MINOR__==5)
192 pi=
static_cast<int64_t *
>(
static_cast<void *
>(&fr));
204 pi=
static_cast<int64_t *
>(
static_cast<void *
>(&fr));
208 int32_t orig_integer_bit;
209 #if defined(__GNUC__) && defined(NDEBUG) && !defined(__clang__) && (__GNUC__==4) && (__GNUC_MINOR__==5)
213 #if defined(__GNUC__) && defined(NDEBUG) && !defined(__clang__) && (__GNUC__==4) && (__GNUC_MINOR__==5)
219 pi=
static_cast<int64_t *
>(
static_cast<void *
>(&fr));
float increment_ulp< float >(const float &f, const int &n_ulp)
Definition: floating_point.hpp:170
uint64_t integer_type
Definition: floating_point.hpp:62
const float_type * set_floating_point_type(const float *pcf)
Definition: floating_point.hpp:74
uint32_t sign
Definition: floating_point.hpp:46
Definition: traits.hpp:27
uint64_t integer_type
Definition: floating_point.hpp:40
integer_type i
Definition: floating_point.hpp:29
Definition: floating_point.hpp:50
Definition: floating_point.hpp:38
double increment_ulp< double >(const double &f, const int &n_ulp)
Definition: floating_point.hpp:184
uint64_t mantissa
Definition: floating_point.hpp:66
struct eli::util::float_type::@2 parts
uint64_t mantissa
Definition: floating_point.hpp:32
uint32_t integer_bit
Definition: floating_point.hpp:67
uint32_t integer_type
Definition: floating_point.hpp:28
std::ostream & operator<<(std::ostream &ostr, const float_type &ft)
Definition: floating_point.hpp:104
integer_type i
Definition: floating_point.hpp:41
uint32_t sign
Definition: floating_point.hpp:34
long double increment_ulp< long double >(const long double &f, const int &n_ulp)
Definition: floating_point.hpp:198
uint32_t exponent
Definition: floating_point.hpp:45
data__ increment_ulp(const data__ &, const int &)
Definition: floating_point.hpp:164
struct eli::util::double_type::@3 parts
uint32_t exponent
Definition: floating_point.hpp:68
Definition: floating_point.hpp:26
uint32_t sign
Definition: floating_point.hpp:69
uint64_t mantissa
Definition: floating_point.hpp:44
struct eli::util::long_double_type::@4 parts
uint32_t exponent
Definition: floating_point.hpp:33
integer_type i[2]
Definition: floating_point.hpp:63