Parma_Polyhedra_Library::float_ibm_single Struct Reference
[C++ Language Interface]

#include <Float.defs.hh>

List of all members.

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

uint32_t word

Static Public Attributes

static const uint32_t SGN_MASK = 0x80000000
static const uint32_t EXP_MASK = 0x7f000000
static const uint32_t POS_INF = 0x7f000000
static const uint32_t NEG_INF = 0xff000000
static const uint32_t POS_ZERO = 0x00000000
static const uint32_t NEG_ZERO = 0x80000000
static const unsigned int BASE = 16
static const unsigned int EXPONENT_BITS = 7
static const unsigned int MANTISSA_BITS = 24
static const int EXPONENT_BIAS = 64
static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1
static const int EXPONENT_MIN = -EXPONENT_MAX + 1
static const int EXPONENT_MIN_DENORM

Detailed Description

Definition at line 153 of file Float.defs.hh.


Member Function Documentation

void Parma_Polyhedra_Library::float_ibm_single::build ( bool  negative,
mpz_t  mantissa,
int  exponent 
) [inline]

Definition at line 282 of file Float.inlines.hh.

References EXPONENT_BIAS, MANTISSA_BITS, SGN_MASK, and word.

00282                                                                    {
00283   word = mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1);
00284   if (negative)
00285     word |= SGN_MASK;
00286   word |= static_cast<uint32_t>(exponent + EXPONENT_BIAS) << MANTISSA_BITS;
00287 }

void Parma_Polyhedra_Library::float_ibm_single::dec (  )  [inline]

Definition at line 265 of file Float.inlines.hh.

References word.

00265                       {
00266   --word;
00267 }

void Parma_Polyhedra_Library::float_ibm_single::inc (  )  [inline]

Definition at line 270 of file Float.inlines.hh.

References word.

00270                       {
00271   ++word;
00272 }

int Parma_Polyhedra_Library::float_ibm_single::is_inf (  )  const [inline]

Definition at line 232 of file Float.inlines.hh.

References NEG_INF, POS_INF, and word.

00232                                {
00233   if (word == NEG_INF)
00234     return -1;
00235   if (word == POS_INF)
00236     return 1;
00237   return 0;
00238 }

int Parma_Polyhedra_Library::float_ibm_single::is_nan (  )  const [inline]

Definition at line 241 of file Float.inlines.hh.

References POS_INF, SGN_MASK, and word.

00241                                {
00242   return (word & ~SGN_MASK) > POS_INF;
00243 }

int Parma_Polyhedra_Library::float_ibm_single::is_zero (  )  const [inline]

Definition at line 246 of file Float.inlines.hh.

References NEG_ZERO, POS_ZERO, and word.

00246                                 {
00247   if (word == NEG_ZERO)
00248     return -1;
00249   if (word == POS_ZERO)
00250     return 1;
00251   return 0;
00252 }

void Parma_Polyhedra_Library::float_ibm_single::negate (  )  [inline]

Definition at line 255 of file Float.inlines.hh.

References SGN_MASK, and word.

00255                          {
00256   word ^= SGN_MASK;
00257 }

void Parma_Polyhedra_Library::float_ibm_single::set_max ( bool  negative  )  [inline]

Definition at line 275 of file Float.inlines.hh.

References SGN_MASK, and word.

00275                                        {
00276   word = 0x7f000000;
00277   if (negative)
00278     word |= SGN_MASK;
00279 }

int Parma_Polyhedra_Library::float_ibm_single::sign_bit (  )  const [inline]

Definition at line 260 of file Float.inlines.hh.

References SGN_MASK, and word.

00260                                  {
00261   return !!(word & SGN_MASK);
00262 }


Member Data Documentation

const unsigned int Parma_Polyhedra_Library::float_ibm_single::BASE = 16 [static]

Definition at line 161 of file Float.defs.hh.

const uint32_t Parma_Polyhedra_Library::float_ibm_single::EXP_MASK = 0x7f000000 [static]

Definition at line 156 of file Float.defs.hh.

Definition at line 164 of file Float.defs.hh.

Referenced by build().

Definition at line 162 of file Float.defs.hh.

Definition at line 165 of file Float.defs.hh.

Definition at line 166 of file Float.defs.hh.

Initial value:
 EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS)

Definition at line 167 of file Float.defs.hh.

Definition at line 163 of file Float.defs.hh.

Referenced by build().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::NEG_INF = 0xff000000 [static]

Definition at line 158 of file Float.defs.hh.

Referenced by is_inf().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::NEG_ZERO = 0x80000000 [static]

Definition at line 160 of file Float.defs.hh.

Referenced by is_zero().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::POS_INF = 0x7f000000 [static]

Definition at line 157 of file Float.defs.hh.

Referenced by is_inf(), and is_nan().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::POS_ZERO = 0x00000000 [static]

Definition at line 159 of file Float.defs.hh.

Referenced by is_zero().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::SGN_MASK = 0x80000000 [static]

Definition at line 155 of file Float.defs.hh.

Referenced by build(), is_nan(), negate(), set_max(), and sign_bit().

Definition at line 154 of file Float.defs.hh.

Referenced by build(), dec(), inc(), is_inf(), is_nan(), is_zero(), negate(), set_max(), and sign_bit().


The documentation for this struct was generated from the following files:
Generated on Sun Feb 27 16:20:19 2011 for PPL by  doxygen 1.6.3