coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
integer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2007-2013 Mike Kinghan, imk@burroingroingjoing.com *
3  * All rights reserved. *
4  * *
5  * Contributed originally by Mike Kinghan, imk@burroingroingjoing.com *
6  * *
7  * Redistribution and use in source and binary forms, with or without *
8  * modification, are permitted provided that the following conditions *
9  * are met: *
10  * *
11  * Redistributions of source code must retain the above copyright *
12  * notice, this list of conditions and the following disclaimer. *
13  * *
14  * Redistributions in binary form must reproduce the above copyright *
15  * notice, this list of conditions and the following disclaimer in the *
16  * documentation and/or other materials provided with the distribution. *
17  * *
18  * Neither the name of Mike Kinghan nor the names of its contributors *
19  * may be used to endorse or promote products derived from this software *
20  * without specific prior written permission. *
21  * *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
29  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED *
30  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
31  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
32  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
33  * DAMAGE. *
34  * *
35  **************************************************************************/
36 
37 #include "integer.h"
38 #include "diagnostic.h"
39 #include "citable.h"
40 #include <cassert>
41 
46 using namespace std;
47 
48 int integer::sign() const
49 {
50  switch(_type) {
51  case INT_INT:
52  return (int)_val < 0 ? -1 : 1;
53  case INT_UINT:
54  return 1;
55  case INT_LONG:
56  return (long)_val < 0L ? -1 : 1;
57  case INT_ULONG:
58  return 1;
59  case INT_LLONG:
60  return (long long)_val < 0LL ? -1 : 1;
61  case INT_ULLONG:
62  return 1;
63  default:
64  return 0;
65  }
66 }
67 
69 integer::result_type(integer const & lhs, integer const & rhs)
70 {
71  if (lhs.type() == INT_UNDEF || rhs.type() == INT_UNDEF) {
72  return INT_UNDEF;
73  }
74  integer_type result = lhs.type() > rhs.type() ? lhs.type() : rhs.type();
75  if (result != lhs._type) {
76  if (!lhs.is_signed() && rank_of(result) == lhs.rank() + 1) {
77  result = to_unsigned(result);
78  }
79  integer test(result,lhs._val);
80  if (test.sign() != lhs.sign() && lhs.sign() < 0) {
81  string orig = citable(lhs);
82  string converted = citable(test);
83  warning_sign_changed() << "Integer " << orig <<
84  " changed to " << converted <<
85  " by the usual arithmetic conversions" << emit();
86  }
87  } else if (result != rhs._type) {
88  if (!rhs.is_signed() && rank_of(result) == rhs.rank() + 1) {
89  result = to_unsigned(result);
90  }
91  integer test(result,rhs._val);
92  if (test.sign() != rhs.sign() && rhs.sign() < 0) {
93  string orig = citable(rhs);
94  string converted = citable(test);
95  warning_sign_changed() << "Integer " << orig <<
96  " changed to " << converted <<
97  " by the usual arithmetic conversions" << emit();
98  }
99  }
100  return result;
101 }
102 
103 
104 bool
105 integer::valid_shift(int direction, integer const & lhs, integer const & rhs)
106 {
107  bool ok = true;
108  size_t type_bits = lhs.size() * 8;
109  unsigned long long val = rhs.raw();
110  if (rhs.is_signed()) {
111  unsigned long long neg_bit = (unsigned long long)1 << (type_bits - 1);
112  if (val & neg_bit) {
113  char const * way = direction < 0 ? "left" : "right";
114  warning_negative_shift() << "Negative " << way <<
115  "-shift has undefined behavior. "
116  "The expression will not be resolved" << emit();
117  ok = false;
118  }
119  }
120  if (ok && val >= type_bits) {
122  "Shifting " << lhs.type_desc() << ' ' << lhs.raw()
123  << " by " << type_bits << " bits has undefined behavior. "
124  << emit();
125  }
126  return ok;
127 }
128 
130 {
131  integer_type type = integer::result_type(*this,rhs);
132  switch(type) {
133  case INT_INT:
134  return integer(INT_INT,(int)_val < (int)rhs.raw());
135  case INT_UINT:
136  return integer(INT_INT,(unsigned)_val < (unsigned)rhs.raw());
137  case INT_LONG:
138  return integer(INT_INT,(long)_val < (long)rhs.raw());
139  case INT_ULONG:
140  return integer(INT_INT,
141  (unsigned long)_val < (unsigned long)rhs.raw());
142  case INT_LLONG:
143  return integer(INT_INT,(long long)_val < (long long)rhs.raw());
144  case INT_ULLONG:
145  return integer(INT_INT,
146  (unsigned long long)_val < (unsigned long long)rhs.raw());
147  default:
148  return integer(INT_UNDEF);
149  }
150 }
151 
153 {
154  integer_type type = integer::result_type(*this,rhs);
155  switch(type) {
156  case INT_INT:
157  return integer(INT_INT,(int)_val <= (int)rhs.raw());
158  case INT_UINT:
159  return integer(INT_INT,(unsigned)_val <= (unsigned)rhs.raw());
160  case INT_LONG:
161  return integer(INT_INT,(long)_val <= (long)rhs.raw());
162  case INT_ULONG:
163  return integer(INT_INT,
164  (unsigned long)_val <= (unsigned long)rhs.raw());
165  case INT_LLONG:
166  return integer(INT_INT,(long long)_val <= (long long)rhs.raw());
167  case INT_ULLONG:
168  return integer(INT_INT,
169  (unsigned long long)_val <= (unsigned long long)rhs.raw());
170  default:
171  return integer(INT_UNDEF);
172  }
173 }
174 
176 {
177  integer_type type = integer::result_type(*this,rhs);
178  switch(type) {
179  case INT_INT:
180  return integer(INT_INT,(int)_val > (int)rhs.raw());
181  case INT_UINT:
182  return integer(INT_INT,(unsigned)_val > (unsigned)rhs.raw());
183  case INT_LONG:
184  return integer(INT_INT,(long)_val > (long)rhs.raw());
185  case INT_ULONG:
186  return integer(INT_INT,
187  (unsigned long)_val > (unsigned long)rhs.raw());
188  case INT_LLONG:
189  return integer(INT_INT,(long long)_val > (long long)rhs.raw());
190  case INT_ULLONG:
191  return integer(INT_INT,
192  (unsigned long long)_val > (unsigned long long)rhs.raw());
193  default:
194  return integer(INT_UNDEF);
195  }
196 }
197 
199 {
200  integer_type type = integer::result_type(*this,rhs);
201  switch(type) {
202  case INT_INT:
203  return integer(INT_INT,(int)_val >= (int)rhs.raw());
204  case INT_UINT:
205  return integer(INT_INT,(unsigned)_val >= (unsigned)rhs.raw());
206  case INT_LONG:
207  return integer(INT_INT,(long)_val >= (long)rhs.raw());
208  case INT_ULONG:
209  return integer(INT_INT,
210  (unsigned long)_val >= (unsigned long)rhs.raw());
211  case INT_LLONG:
212  return integer(INT_INT,(long long)_val >= (long long)rhs.raw());
213  case INT_ULLONG:
214  return integer(INT_INT,
215  (unsigned long long)_val >= (unsigned long long)rhs.raw());
216  default:
217  return integer(INT_UNDEF);
218  }
219 }
220 
222 {
223  integer_type type = integer::result_type(*this,rhs);
224  switch(type) {
225  case INT_INT:
226  return integer(INT_INT,(int)_val != (int)rhs.raw());
227  case INT_UINT:
228  return integer(INT_INT,(unsigned)_val != (unsigned)rhs.raw());
229  case INT_LONG:
230  return integer(INT_INT,(long)_val != (long)rhs.raw());
231  case INT_ULONG:
232  return integer(INT_INT,
233  (unsigned long)_val != (unsigned long)rhs.raw());
234  case INT_LLONG:
235  return integer(INT_INT,(long long)_val != (long long)rhs.raw());
236  case INT_ULLONG:
237  return integer(INT_INT,
238  (unsigned long long)_val != (unsigned long long)rhs.raw());
239  default:
240  return integer(INT_UNDEF);
241  }
242 }
243 
245 {
246  integer_type type = integer::result_type(*this,rhs);
247  switch(type) {
248  case INT_INT:
249  return integer(INT_INT,(int)_val == (int)rhs.raw());
250  case INT_UINT:
251  return integer(INT_INT,(unsigned)_val == (unsigned)rhs.raw());
252  case INT_LONG:
253  return integer(INT_INT,(long)_val == (long)rhs.raw());
254  case INT_ULONG:
255  return integer(INT_INT,
256  (unsigned long)_val == (unsigned long)rhs.raw());
257  case INT_LLONG:
258  return integer(INT_INT,(long long)_val == (long long)rhs.raw());
259  case INT_ULLONG:
260  return integer(INT_INT,
261  (unsigned long long)_val == (unsigned long long)rhs.raw());
262  default:
263  return integer(INT_UNDEF);
264  }
265 }
266 
268 {
269  integer_type type = integer::result_type(*this,rhs);
270  switch(type) {
271  case INT_INT:
272  return integer(INT_INT,(int)_val && (int)rhs.raw());
273  case INT_UINT:
274  return integer(INT_INT,(unsigned)_val && (unsigned)rhs.raw());
275  case INT_LONG:
276  return integer(INT_INT,(long)_val && (long)rhs.raw());
277  case INT_ULONG:
278  return integer(INT_INT,
279  (unsigned long)_val && (unsigned long)rhs.raw());
280  case INT_LLONG:
281  return integer(INT_INT,(long long)_val && (long long)rhs.raw());
282  case INT_ULLONG:
283  return integer(INT_INT,
284  (unsigned long long)_val && (unsigned long long)rhs.raw());
285  default:
286  return integer(INT_UNDEF);
287  }
288 }
289 
291 {
292  integer_type type = integer::result_type(*this,rhs);
293  switch(type) {
294  case INT_INT:
295  return integer(INT_INT,(int)_val || (int)rhs.raw());
296  case INT_UINT:
297  return integer(INT_INT,(unsigned)_val || (unsigned)rhs.raw());
298  case INT_LONG:
299  return integer(INT_INT,(long)_val || (long)rhs.raw());
300  case INT_ULONG:
301  return integer(INT_INT,
302  (unsigned long)_val || (unsigned long)rhs.raw());
303  case INT_LLONG:
304  return integer(INT_INT,(long long)_val || (long long)rhs.raw());
305  case INT_ULLONG:
306  return integer(INT_INT,
307  (unsigned long long)_val || (unsigned long long)rhs.raw());
308  default:
309  return integer(INT_UNDEF);
310  }
311 }
312 
314 {
315  integer_type type = integer::result_type(*this,rhs);
316  switch(type) {
317  case INT_INT:
318  return integer(INT_INT,(int)_val & (int)rhs.raw());
319  case INT_UINT:
320  return integer(INT_INT,(unsigned)_val & (unsigned)rhs.raw());
321  case INT_LONG:
322  return integer(INT_INT,(long)_val & (long)rhs.raw());
323  case INT_ULONG:
324  return integer(INT_INT,
325  (unsigned long)_val & (unsigned long)rhs.raw());
326  case INT_LLONG:
327  return integer(INT_INT,(long long)_val & (long long)rhs.raw());
328  case INT_ULLONG:
329  return integer(INT_INT,
330  (unsigned long long)_val & (unsigned long long)rhs.raw());
331  default:
332  return integer(INT_UNDEF);
333  }
334 }
335 
337 {
338  integer_type type = integer::result_type(*this,rhs);
339  switch(type) {
340  case INT_INT:
341  return integer(INT_INT,(int)_val | (int)rhs.raw());
342  case INT_UINT:
343  return integer(INT_INT,(unsigned)_val | (unsigned)rhs.raw());
344  case INT_LONG:
345  return integer(INT_INT,(long)_val | (long)rhs.raw());
346  case INT_ULONG:
347  return integer(INT_INT,
348  (unsigned long)_val | (unsigned long)rhs.raw());
349  case INT_LLONG:
350  return integer(INT_INT,(long long)_val | (long long)rhs.raw());
351  case INT_ULLONG:
352  return integer(INT_INT,
353  (unsigned long long)_val | (unsigned long long)rhs.raw());
354  default:
355  return integer(INT_UNDEF);
356  }
357 }
358 
360 {
361  integer_type type = integer::result_type(*this,rhs);
362  switch(type) {
363  case INT_INT:
364  return integer(INT_INT,(int)_val ^ (int)rhs.raw());
365  case INT_UINT:
366  return integer(INT_INT,(unsigned)_val ^ (unsigned)rhs.raw());
367  case INT_LONG:
368  return integer(INT_INT,(long)_val ^ (long)rhs.raw());
369  case INT_ULONG:
370  return integer(INT_INT,
371  (unsigned long)_val ^ (unsigned long)rhs.raw());
372  case INT_LLONG:
373  return integer(INT_INT,(long long)_val ^ (long long)rhs.raw());
374  case INT_ULLONG:
375  return integer(INT_INT,
376  (unsigned long long)_val ^ (unsigned long long)rhs.raw());
377  default:
378  return integer(INT_UNDEF);
379  }
380 }
381 
383 {
384  switch(_type) {
385  case INT_INT:
386  return integer(_type,-(int)_val);
387  case INT_UINT:
388  return integer(_type,-(unsigned)_val);
389  case INT_LONG:
390  return integer(_type,-(long)_val);
391  case INT_ULONG:
392  return integer(_type,-(unsigned long)_val);
393  case INT_LLONG:
394  return integer(_type,-(long long)_val);
395  case INT_ULLONG:
396  return integer(_type,-(unsigned long long)_val);
397  default:
398  return integer(INT_UNDEF);
399  }
400 }
401 
403 {
404  switch(_type) {
405  case INT_INT:
406  return integer(_type,~(int)_val);
407  case INT_UINT:
408  return integer(_type,~(unsigned)_val);
409  case INT_LONG:
410  return integer(_type,~(long)_val);
411  case INT_ULONG:
412  return integer(_type,~(unsigned long)_val);
413  case INT_LLONG:
414  return integer(_type,~(long long)_val);
415  case INT_ULLONG:
416  return integer(_type,~(unsigned long long)_val);
417  default:
418  return integer(INT_UNDEF);
419  }
420 }
421 
423 {
424  integer_type type = integer::result_type(*this,rhs);
425  switch(type) {
426  case INT_INT:
427  return integer(type,(int)_val + (int)rhs.raw());
428  case INT_UINT:
429  return integer(type,(unsigned)_val + (unsigned)rhs.raw());
430  case INT_LONG:
431  return integer(type,(long)_val + (long)rhs.raw());
432  case INT_ULONG:
433  return integer(type,
434  (unsigned long)_val + (unsigned long)rhs.raw());
435  case INT_LLONG:
436  return integer(type,(long long)_val + (long long)rhs.raw());
437  case INT_ULLONG:
438  return integer(type,
439  (unsigned long long)_val + (unsigned long long)rhs.raw());
440  default:
441  return integer(INT_UNDEF);
442  }
443 }
444 
446 {
447  integer_type type = integer::result_type(*this,rhs);
448  switch(type) {
449  case INT_INT:
450  return integer(type,(int)_val - (int)rhs.raw());
451  case INT_UINT:
452  return integer(type,(unsigned)_val - (unsigned)rhs.raw());
453  case INT_LONG:
454  return integer(type,(long)_val - (long)rhs.raw());
455  case INT_ULONG:
456  return integer(type,
457  (unsigned long)_val - (unsigned long)rhs.raw());
458  case INT_LLONG:
459  return integer(type,(long long)_val - (long long)rhs.raw());
460  case INT_ULLONG:
461  return integer(type,
462  (unsigned long long)_val - (unsigned long long)rhs.raw());
463  default:
464  return integer(INT_UNDEF);
465  }
466 }
467 
469 {
470  integer_type type = integer::result_type(*this,rhs);
471  switch(type) {
472  case INT_INT:
473  return integer(type,(int)_val * (int)rhs.raw());
474  case INT_UINT:
475  return integer(type,(unsigned)_val * (unsigned)rhs.raw());
476  case INT_LONG:
477  return integer(type,(long)_val * (long)rhs.raw());
478  case INT_ULONG:
479  return integer(type,
480  (unsigned long)_val * (unsigned long)rhs.raw());
481  case INT_LLONG:
482  return integer(type,(long long)_val * (long long)rhs.raw());
483  case INT_ULLONG:
484  return integer(type,
485  (unsigned long long)_val * (unsigned long long)rhs.raw());
486  default:
487  return integer(INT_UNDEF);
488  }
489 }
490 
492 {
493  integer_type type = integer::result_type(*this,rhs);
494  switch(type) {
495  case INT_INT:
496  return integer(type,(int)_val / (int)rhs.raw());
497  case INT_UINT:
498  return integer(type,(unsigned)_val / (unsigned)rhs.raw());
499  case INT_LONG:
500  return integer(type,(long)_val / (long)rhs.raw());
501  case INT_ULONG:
502  return integer(type,
503  (unsigned long)_val / (unsigned long)rhs.raw());
504  case INT_LLONG:
505  return integer(type,(long long)_val / (long long)rhs.raw());
506  case INT_ULLONG:
507  return integer(type,
508  (unsigned long long)_val / (unsigned long long)rhs.raw());
509  default:
510  return integer(INT_UNDEF);
511  }
512 }
513 
515 {
516  integer_type type = integer::result_type(*this,rhs);
517  switch(type) {
518  case INT_INT:
519  return integer(type,(int)_val % (int)rhs.raw());
520  case INT_UINT:
521  return integer(type,(unsigned)_val % (unsigned)rhs.raw());
522  case INT_LONG:
523  return integer(type,(long)_val % (long)rhs.raw());
524  case INT_ULONG:
525  return integer(type,
526  (unsigned long)_val % (unsigned long)rhs.raw());
527  case INT_LLONG:
528  return integer(type,(long long)_val % (long long)rhs.raw());
529  case INT_ULLONG:
530  return integer(type,
531  (unsigned long long)_val % (unsigned long long)rhs.raw());
532  default:
533  return integer(INT_UNDEF);
534  }
535 }
536 
538 {
539  integer_type type_check = integer::result_type(*this,rhs);
540  if (type_check == INT_UNDEF || !integer::valid_shift(-1,*this,rhs)) {
541  return integer(INT_UNDEF);
542  }
543  switch(_type) {
544  case INT_INT:
545  return integer(_type,(int)_val << (int)rhs.raw());
546  case INT_UINT:
547  return integer(_type,(unsigned)_val << (unsigned)rhs.raw());
548  case INT_LONG:
549  return integer(_type,(long)_val << (long)rhs.raw());
550  case INT_ULONG:
551  return integer(_type,
552  (unsigned long)_val << (unsigned long)rhs.raw());
553  case INT_LLONG:
554  return integer(_type,(long long)_val << (long long)rhs.raw());
555  case INT_ULLONG:
556  return integer(_type,
557  (unsigned long long)_val << (unsigned long long)rhs.raw());
558  default:
559  return integer(INT_UNDEF);
560  }
561 }
562 
564 {
565  integer_type type_check = integer::result_type(*this,rhs);
566  if (type_check == INT_UNDEF || !valid_shift(1,*this,rhs)) {
567  return integer(INT_UNDEF);
568  }
569  switch(_type) {
570  case INT_INT:
571  return integer(_type,(int)_val >> (int)rhs.raw());
572  case INT_UINT:
573  return integer(_type,(unsigned)_val >> (unsigned)rhs.raw());
574  case INT_LONG:
575  return integer(_type,(long)_val >> (long)rhs.raw());
576  case INT_ULONG:
577  return integer(_type,
578  (unsigned long)_val >> (unsigned long)rhs.raw());
579  case INT_LLONG:
580  return integer(_type,(long long)_val >> (long long)rhs.raw());
581  case INT_ULLONG:
582  return integer(_type,
583  (unsigned long long)_val >> (unsigned long long)rhs.raw());
584  default:
585  return integer(INT_UNDEF);
586  }
587 }
588 
590 {
591  switch(it) {
592  case INT_INT:
593  return "int";
594  case INT_UINT:
595  return "unsigned int";
596  case INT_LONG:
597  return "long int";
598  case INT_ULONG:
599  return "unsigned long int";
600  case INT_LLONG:
601  return "long long int";
602  case INT_ULLONG:
603  return "unsigned long long int";
604  default:
605  assert(false);
606  }
607  return "";
608 }
609 
610 // EOF
static integer_type result_type(integer const &lhs, integer const &rhs)
Definition: integer.cpp:69
unsigned long long raw() const
Get the bits comprising the integer as an unsigned long long
Definition: integer.h:93
Type long long int
Definition: integer.h:59
integer operator&&(integer const &rhs) const
Definition: integer.cpp:267
size_t size() const
Get the size of the integer
Definition: integer.h:85
integer operator>(integer const &rhs) const
Definition: integer.cpp:175
integer operator<(integer const &rhs) const
Definition: integer.cpp:129
integer operator*(integer const &rhs) const
Definition: integer.cpp:468
integer_type _type
The type of the integer.
Definition: integer.h:320
Type unsigned long
Definition: integer.h:57
warning_msg< 23 > warning_shift_overflow
Report a that shift count is >= the width of the shifted quantity.
Definition: diagnostic.h:695
integer operator^(integer const &rhs) const
Definition: integer.cpp:359
Undetermined type or invalid.
Definition: integer.h:49
Class integer encapsulates an integer of some type.
Definition: integer.h:65
integer operator>=(integer const &rhs) const
Definition: integer.cpp:198
std::string citable(chewer< std::string > &chew, size_t len=std::string::npos)
Make a citable version of length-delimited text.
integer operator+() const
Definition: integer.h:195
warning_msg< 20 > warning_negative_shift
Report negative shift count.
Definition: diagnostic.h:689
Type int
Definition: integer.h:51
integer operator-() const
Definition: integer.cpp:382
int sign() const
Definition: integer.cpp:48
static bool valid_shift(int direction, integer const &lhs, integer const &rhs)
Definition: integer.cpp:105
Type long
Definition: integer.h:55
char const * type_desc() const
Get the text descriptor of this integer's type.
Definition: integer.h:98
integer_type
Enumerated constants denoting integral types.
Definition: integer.h:47
The tag class is inserted in a diagnostic_base to tell it to emit itself.
Definition: diagnostic.h:77
warning_msg< 22 > warning_sign_changed
Report integer sign changed by promotion.
Definition: diagnostic.h:693
integer operator/(integer const &rhs) const
Definition: integer.cpp:491
integer operator~() const
Definition: integer.cpp:402
integer operator==(integer const &rhs) const
Definition: integer.cpp:244
unsigned long long _val
The value of the integer
Definition: integer.h:318
integer operator<=(integer const &rhs) const
Definition: integer.cpp:152
unsigned rank() const
Get the conversion rank of an integer
Definition: integer.h:268
Type unsigned long long
Definition: integer.h:61
integer_type type() const
Get the type of the integer
Definition: integer.h:77
integer operator<<(integer const &rhs) const
Definition: integer.cpp:537
integer operator|(integer const &rhs) const
Definition: integer.cpp:336
integer operator&(integer const &rhs) const
Definition: integer.cpp:313
integer operator>>(integer const &rhs) const
Definition: integer.cpp:563
integer operator!=(integer const &rhs) const
Definition: integer.cpp:221
integer operator%(integer const &rhs) const
Definition: integer.cpp:514
Type unsigned
Definition: integer.h:53
integer operator||(integer const &rhs) const
Definition: integer.cpp:290
bool is_signed() const
Say whether the integer is of signed type.
Definition: integer.h:89