#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 | BASE = 2 |
| 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 235 of file Float.defs.hh.
| void Parma_Polyhedra_Library::float_ieee754_quad::build | ( | bool | negative, | |
| mpz_t | mantissa, | |||
| int | exponent | |||
| ) | [inline] |
Definition at line 436 of file Float.inlines.hh.
References EXPONENT_BIAS, lsp, MANTISSA_BITS, msp, and MSP_SGN_MASK.
00436 { 00437 uint64_t parts[2]; 00438 mpz_export(parts, 0, -1, 8, 0, 0, mantissa); 00439 lsp = parts[0]; 00440 msp = parts[1]; 00441 msp &= ((1ULL << (MANTISSA_BITS - 64)) - 1); 00442 if (negative) 00443 msp |= MSP_SGN_MASK; 00444 msp |= static_cast<uint64_t>(exponent + EXPONENT_BIAS) 00445 << (MANTISSA_BITS - 64); 00446 }
| void Parma_Polyhedra_Library::float_ieee754_quad::dec | ( | ) | [inline] |
| void Parma_Polyhedra_Library::float_ieee754_quad::inc | ( | ) | [inline] |
| int Parma_Polyhedra_Library::float_ieee754_quad::is_inf | ( | ) | const [inline] |
Definition at line 370 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.
00370 { 00371 if (lsp != LSP_INF) 00372 return 0; 00373 if (msp == MSP_NEG_INF) 00374 return -1; 00375 if (msp == MSP_POS_INF) 00376 return 1; 00377 return 0; 00378 }
| int Parma_Polyhedra_Library::float_ieee754_quad::is_nan | ( | ) | const [inline] |
Definition at line 381 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_POS_INF, and MSP_SGN_MASK.
00381 { 00382 return (msp & ~MSP_SGN_MASK) == MSP_POS_INF 00383 && lsp != LSP_INF; 00384 }
| int Parma_Polyhedra_Library::float_ieee754_quad::is_zero | ( | ) | const [inline] |
Definition at line 387 of file Float.inlines.hh.
References lsp, LSP_ZERO, msp, MSP_NEG_ZERO, and MSP_POS_ZERO.
00387 { 00388 if (lsp != LSP_ZERO) 00389 return 0; 00390 if (msp == MSP_NEG_ZERO) 00391 return -1; 00392 if (msp == MSP_POS_ZERO) 00393 return 1; 00394 return 0; 00395 }
| void Parma_Polyhedra_Library::float_ieee754_quad::negate | ( | ) | [inline] |
Definition at line 398 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00398 { 00399 msp ^= MSP_SGN_MASK; 00400 }
| void Parma_Polyhedra_Library::float_ieee754_quad::set_max | ( | bool | negative | ) | [inline] |
Definition at line 428 of file Float.inlines.hh.
References lsp, msp, and MSP_SGN_MASK.
00428 { 00429 msp = 0x7ffeffffffffffffULL; 00430 lsp = 0xffffffffffffffffULL; 00431 if (negative) 00432 msp |= MSP_SGN_MASK; 00433 }
| int Parma_Polyhedra_Library::float_ieee754_quad::sign_bit | ( | ) | const [inline] |
Definition at line 403 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00403 { 00404 return !!(msp & MSP_SGN_MASK); 00405 }
const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::BASE = 2 [static] |
Definition at line 251 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_BIAS = EXPONENT_MAX [static] |
Definition at line 255 of file Float.defs.hh.
Referenced by build().
const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_BITS = 15 [static] |
Definition at line 252 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1 [static] |
Definition at line 254 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MIN = -EXPONENT_MAX + 1 [static] |
Definition at line 256 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_ieee754_quad::EXPONENT_MIN_DENORM [static] |
EXPONENT_MIN - static_cast<int>(MANTISSA_BITS)
Definition at line 257 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_INF = 0 [static] |
Definition at line 248 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_MAX = 0xffffffffffffffffULL [static] |
Definition at line 250 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_ZERO = 0 [static] |
Definition at line 249 of file Float.defs.hh.
Referenced by is_zero().
const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::MANTISSA_BITS = 112 [static] |
Definition at line 253 of file Float.defs.hh.
Referenced by build().
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_INF = 0xffff000000000000ULL [static] |
Definition at line 245 of file Float.defs.hh.
Referenced by is_inf().
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_ZERO = 0x8000000000000000ULL [static] |
Definition at line 247 of file Float.defs.hh.
Referenced by is_zero().
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_INF = 0x7fff000000000000ULL [static] |
Definition at line 244 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_ZERO = 0x0000000000000000ULL [static] |
Definition at line 246 of file Float.defs.hh.
Referenced by is_zero().
const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_SGN_MASK = 0x8000000000000000ULL [static] |
Definition at line 243 of file Float.defs.hh.
Referenced by build(), is_nan(), negate(), set_max(), and sign_bit().
1.6.3