PPL  1.2
Concrete_Expression.cc
Go to the documentation of this file.
1 /* Concrete_Expression class implementation (non-inline functions).
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #include "ppl-config.h"
26 #include <iostream>
27 
28 namespace PPL = Parma_Polyhedra_Library;
29 
30 bool
32  if (impl.bounded_integer) {
38 #ifndef NDEBUG
39  std::cerr << "bounded integer type has illegal width "
41  << std::endl;
42 #endif
43  return false;
44  }
45 
48 #ifndef NDEBUG
49  std::cerr << "bounded integer type has illegal representation "
51  << std::endl;
52 #endif
53  return false;
54  }
55 
59 #ifndef NDEBUG
60  std::cerr << "bounded integer type has illegal overflow "
62  << std::endl;
63 #endif
64  return false;
65  }
66 
68 #ifndef NDEBUG
69  std::cerr << "bounded integer type has illegal (unused) fp format "
71  << std::endl;
72 #endif
73  return false;
74  }
75  }
76  else {
77  // Here we have impl.bounded_integer == false.
84 #ifndef NDEBUG
85  std::cerr << "floating point type has illegal format "
87  << std::endl;
88 #endif
89  return false;
90  }
91 
93 #ifdef NDEBUG
94  std::cerr << "floating point type has illegal (unused) bi width "
96  << std::endl;
97 #endif
98  return false;
99  }
100 
102 #ifndef NDEBUG
103  std::cerr << "floating point type has illegal (unused) bi representation "
105  << std::endl;
106 #endif
107  return false;
108  }
109 
111 #ifndef NDEBUG
112  std::cerr << "floating point type has illegal (unused) bi overflow "
114  << std::endl;
115 #endif
116  return false;
117  }
118  }
119 
120  // If we got here, everything is OK.
121  return true;
122 }
IEEE 754 half precision, 16 bits (5 exponent, 10 mantissa).
IEEE 754 quad precision, 128 bits (15 exponent, 112 mantissa).
IBM single precision, 32 bits (7 exponent, 24 mantissa).
On overflow, wrapping takes place.
On overflow, the result is undefined.
Intel double extended precision, 80 bits (15 exponent, 64 mantissa)
The entire library is confined to this namespace.
Definition: version.hh:61
IEEE 754 double precision, 64 bits (11 exponent, 52 mantissa).
Signed binary where negative values are represented by the two's complement of the absolute value...
IEEE 754 single precision, 32 bits (8 exponent, 23 mantissa).
bool OK() const
Checks if all the invariants are satisfied.