1 -- Copyright 2012-2016 Free Software Foundation, Inc.
3 -- This program is free software; you can redistribute it and/or modify
4 -- it under the terms of the GNU General Public License as published by
5 -- the Free Software Foundation; either version 3 of the License, or
6 -- (at your option) any later version.
8 -- This program is distributed in the hope that it will be useful,
9 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
10 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 -- GNU General Public License for more details.
13 -- You should have received a copy of the GNU General Public License
14 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
18 function Make (X: Natural) return Int is
23 function "+" (I1, I2 : Int) return Int is
25 return Int (IntRep (I1) + IntRep (I2));
28 function "-" (I1, I2 : Int) return Int is
30 return Int (IntRep (I1) - IntRep (I2));
33 function "*" (I1, I2 : Int) return Int is
35 return Int (IntRep (I1) * IntRep (I2));
38 function "/" (I1, I2 : Int) return Int is
40 return Int (IntRep (I1) / IntRep (I2));
43 function "mod" (I1, I2 : Int) return Int is
45 return Int (IntRep (I1) mod IntRep (I2));
48 function "rem" (I1, I2 : Int) return Int is
50 return Int (IntRep (I1) rem IntRep (I2));
53 function "**" (I1, I2 : Int) return Int is
56 for J in 1 .. IntRep (I2) loop
57 Result := IntRep (I1) * Result;
62 function "<" (I1, I2 : Int) return Boolean is
64 return IntRep (I1) < IntRep (I2);
67 function "<=" (I1, I2 : Int) return Boolean is
69 return IntRep (I1) <= IntRep (I2);
72 function ">" (I1, I2 : Int) return Boolean is
74 return IntRep (I1) > IntRep (I2);
77 function ">=" (I1, I2 : Int) return Boolean is
79 return IntRep (I1) >= IntRep (I2);
82 function "=" (I1, I2 : Int) return Boolean is
84 return IntRep (I1) = IntRep (I2);
87 function "and" (I1, I2 : Int) return Int is
89 return Int (IntRep (I1) and IntRep (I2));
92 function "or" (I1, I2 : Int) return Int is
94 return Int (IntRep (I1) or IntRep (I2));
97 function "xor" (I1, I2 : Int) return Int is
99 return Int (IntRep (I1) xor IntRep (I2));
102 function "&" (I1, I2 : Int) return Int is
104 return Int (IntRep (I1) and IntRep (I2));
107 function "abs" (I1 : Int) return Int is
109 return Int (abs IntRep (I1));
112 function "not" (I1 : Int) return Int is
114 return Int (not IntRep (I1));
117 function "+" (I1 : Int) return Int is
119 return Int (IntRep (I1));
122 function "-" (I1 : Int) return Int is
124 return Int (-IntRep (I1));
127 procedure Dummy (I1 : Int) is
132 procedure Dummy (B1 : Boolean) is