|
PPL
0.12.1
|
#include <Float.defs.hh>
Public Member Functions | |
| int | inf_sign () const |
| bool | is_nan () const |
| int | zero_sign () const |
| bool | 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 = static_cast<uint64_t>(0x8000000000000000ULL) |
| static const uint64_t | MSP_POS_INF = static_cast<uint64_t>(0x7fff000000000000ULL) |
| static const uint64_t | MSP_NEG_INF = static_cast<uint64_t>(0xffff000000000000ULL) |
| static const uint64_t | MSP_POS_ZERO = static_cast<uint64_t>(0x0000000000000000ULL) |
| static const uint64_t | MSP_NEG_ZERO = static_cast<uint64_t>(0x8000000000000000ULL) |
| static const uint64_t | LSP_INF = 0 |
| static const uint64_t | LSP_ZERO = 0 |
| static const uint64_t | LSP_MAX = static_cast<uint64_t>(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 240 of file Float.defs.hh.
|
inline |
Definition at line 451 of file Float.inlines.hh.
References EXPONENT_BIAS, EXPONENT_BITS, lsp, MANTISSA_BITS, msp, MSP_SGN_MASK, and PPL_ASSERT.
{
uint64_t parts[2];
mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
lsp = parts[0];
msp = parts[1];
msp &= ((static_cast<uint64_t>(1) << (MANTISSA_BITS - 64)) - 1);
if (negative)
msp |= MSP_SGN_MASK;
int exponent_repr = exponent + EXPONENT_BIAS;
PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS));
msp |= static_cast<uint64_t>(exponent_repr) << (MANTISSA_BITS - 64);
}
|
inline |
|
inline |
|
inline |
Definition at line 385 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.
{
if (lsp != LSP_INF)
return 0;
if (msp == MSP_NEG_INF)
return -1;
if (msp == MSP_POS_INF)
return 1;
return 0;
}
|
inline |
Definition at line 396 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_POS_INF, and MSP_SGN_MASK.
{
return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
&& lsp != LSP_INF;
}
|
inline |
Definition at line 413 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
{
msp ^= MSP_SGN_MASK;
}
|
inline |
Definition at line 443 of file Float.inlines.hh.
References lsp, msp, and MSP_SGN_MASK.
{
msp = static_cast<uint64_t>(0x7ffeffffffffffffULL);
lsp = static_cast<uint64_t>(0xffffffffffffffffULL);
if (negative)
msp |= MSP_SGN_MASK;
}
|
inline |
Definition at line 418 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
{
return (msp & MSP_SGN_MASK) != 0;
}
|
inline |
Definition at line 402 of file Float.inlines.hh.
References lsp, LSP_ZERO, msp, MSP_NEG_ZERO, and MSP_POS_ZERO.
{
if (lsp != LSP_ZERO)
return 0;
if (msp == MSP_NEG_ZERO)
return -1;
if (msp == MSP_POS_ZERO)
return 1;
return 0;
}
|
static |
Definition at line 256 of file Float.defs.hh.
Referenced by Parma_Polyhedra_Library::compute_absolute_error(), and Parma_Polyhedra_Library::Linear_Form< C >::relative_error().
|
static |
Definition at line 260 of file Float.defs.hh.
Referenced by build(), and Parma_Polyhedra_Library::compute_absolute_error().
|
static |
Definition at line 257 of file Float.defs.hh.
Referenced by build().
|
static |
Definition at line 259 of file Float.defs.hh.
|
static |
Definition at line 261 of file Float.defs.hh.
|
static |
EXPONENT_MIN - static_cast<int>(MANTISSA_BITS)
Definition at line 262 of file Float.defs.hh.
Definition at line 245 of file Float.defs.hh.
Referenced by build(), dec(), inc(), inf_sign(), is_nan(), set_max(), and zero_sign().
|
static |
Definition at line 253 of file Float.defs.hh.
Referenced by inf_sign(), and is_nan().
|
static |
Definition at line 255 of file Float.defs.hh.
|
static |
Definition at line 254 of file Float.defs.hh.
Referenced by zero_sign().
|
static |
Definition at line 258 of file Float.defs.hh.
Referenced by build(), Parma_Polyhedra_Library::compute_absolute_error(), and Parma_Polyhedra_Library::Linear_Form< C >::relative_error().
Definition at line 246 of file Float.defs.hh.
Referenced by build(), dec(), inc(), inf_sign(), is_nan(), negate(), set_max(), sign_bit(), and zero_sign().
|
static |
Definition at line 250 of file Float.defs.hh.
Referenced by inf_sign().
|
static |
Definition at line 252 of file Float.defs.hh.
Referenced by zero_sign().
|
static |
Definition at line 249 of file Float.defs.hh.
Referenced by inf_sign(), and is_nan().
|
static |
Definition at line 251 of file Float.defs.hh.
Referenced by zero_sign().
|
static |
Definition at line 248 of file Float.defs.hh.
Referenced by build(), is_nan(), negate(), set_max(), and sign_bit().