#include <Float.defs.hh>
Public Member Functions | |
int | is_inf () const |
int | is_nan () const |
int | is_zero () const |
int | sign_bit () const |
void | negate () |
void | dec () |
void | inc () |
void | set_max (bool negative) |
void | build (bool negative, mpz_t mantissa, int exponent) |
Public Attributes | |
uint64_t | lsp |
uint64_t | msp |
Static Public Attributes | |
static const uint64_t | MSP_SGN_MASK = 0x8000000000000000ULL |
static const uint64_t | MSP_POS_INF = 0x7fff000000000000ULL |
static const uint64_t | MSP_NEG_INF = 0xffff000000000000ULL |
static const uint64_t | MSP_POS_ZERO = 0x0000000000000000ULL |
static const uint64_t | MSP_NEG_ZERO = 0x8000000000000000ULL |
static const uint64_t | LSP_INF = 0 |
static const uint64_t | LSP_ZERO = 0 |
static const uint64_t | LSP_MAX = 0xffffffffffffffffULL |
static const unsigned int | EXPONENT_BITS = 15 |
static const unsigned int | MANTISSA_BITS = 112 |
static const int | EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1 |
static const int | EXPONENT_BIAS = EXPONENT_MAX |
static const int | EXPONENT_MIN = -EXPONENT_MAX + 1 |
static const int | EXPONENT_MIN_DENORM |
Definition at line 149 of file Float.defs.hh.
int Parma_Polyhedra_Library::float_ieee754_quad::is_inf | ( | ) | const [inline] |
Definition at line 253 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.
00253 { 00254 if (lsp != LSP_INF) 00255 return 0; 00256 if (msp == MSP_NEG_INF) 00257 return -1; 00258 if (msp == MSP_POS_INF) 00259 return 1; 00260 return 0; 00261 }
int Parma_Polyhedra_Library::float_ieee754_quad::is_nan | ( | ) | const [inline] |
Definition at line 264 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_POS_INF, and MSP_SGN_MASK.
00264 { 00265 return (msp & ~MSP_SGN_MASK) == MSP_POS_INF 00266 && lsp != LSP_INF; 00267 }
int Parma_Polyhedra_Library::float_ieee754_quad::is_zero | ( | ) | const [inline] |
Definition at line 270 of file Float.inlines.hh.
References lsp, LSP_ZERO, msp, MSP_NEG_ZERO, and MSP_POS_ZERO.
00270 { 00271 if (lsp != LSP_ZERO) 00272 return 0; 00273 if (msp == MSP_NEG_ZERO) 00274 return -1; 00275 if (msp == MSP_POS_ZERO) 00276 return 1; 00277 return 0; 00278 }
int Parma_Polyhedra_Library::float_ieee754_quad::sign_bit | ( | ) | const [inline] |
Definition at line 286 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00286 { 00287 return !!(msp & MSP_SGN_MASK); 00288 }
void Parma_Polyhedra_Library::float_ieee754_quad::negate | ( | ) | [inline] |
Definition at line 281 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00281 { 00282 msp ^= MSP_SGN_MASK; 00283 }
void Parma_Polyhedra_Library::float_ieee754_quad::dec | ( | ) | [inline] |
void Parma_Polyhedra_Library::float_ieee754_quad::inc | ( | ) | [inline] |
void Parma_Polyhedra_Library::float_ieee754_quad::set_max | ( | bool | negative | ) | [inline] |
Definition at line 311 of file Float.inlines.hh.
References lsp, msp, and MSP_SGN_MASK.
00311 { 00312 msp = 0x7ffeffffffffffffULL; 00313 lsp = 0xffffffffffffffffULL; 00314 if (negative) 00315 msp |= MSP_SGN_MASK; 00316 }
void Parma_Polyhedra_Library::float_ieee754_quad::build | ( | bool | negative, | |
mpz_t | mantissa, | |||
int | exponent | |||
) | [inline] |
Definition at line 319 of file Float.inlines.hh.
References EXPONENT_BIAS, lsp, MANTISSA_BITS, msp, and MSP_SGN_MASK.
00319 { 00320 uint64_t parts[2]; 00321 mpz_export(parts, 0, -1, 8, 0, 0, mantissa); 00322 lsp = parts[0]; 00323 msp = parts[1]; 00324 msp &= ((1ULL << (MANTISSA_BITS - 64)) - 1); 00325 if (negative) 00326 msp |= MSP_SGN_MASK; 00327 msp |= static_cast<uint64_t>(exponent + EXPONENT_BIAS) 00328 << (MANTISSA_BITS - 64); 00329 }
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_SGN_MASK = 0x8000000000000000ULL [static] |
Definition at line 157 of file Float.defs.hh.
Referenced by build(), is_nan(), negate(), set_max(), and sign_bit().
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_INF = 0x7fff000000000000ULL [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_INF = 0xffff000000000000ULL [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_ZERO = 0x0000000000000000ULL [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_ZERO = 0x8000000000000000ULL [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_INF = 0 [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_ZERO = 0 [static] |
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_MAX = 0xffffffffffffffffULL [static] |
const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_BITS = 15 [static] |
Definition at line 165 of file Float.defs.hh.
const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::MANTISSA_BITS = 112 [static] |
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1 [static] |
Definition at line 167 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_BIAS = EXPONENT_MAX [static] |
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MIN = -EXPONENT_MAX + 1 [static] |
Definition at line 169 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MIN_DENORM [static] |
Initial value:
EXPONENT_MIN - static_cast<int>(MANTISSA_BITS)
Definition at line 170 of file Float.defs.hh.