2 Copyright (c) 2000-2015 Ericsson Telecom AB
4 All rights reserved. This program and the accompanying materials
5 are made available under the terms of the Eclipse Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/epl-v10.html
11 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
12 <meta http-equiv=
"Content-Language" content=
"en-us">
13 <title>integer
</title>
15 <body bgcolor=
"#DAD3C5" vlink=
"#0094D2" link=
"#003258">
16 <table align=
"left" border=
"0" cellspacing=
"0" cellpadding=
"0" valign=top
>
18 <td width=
105 height=
40><a href=
"https://projects.eclipse.org/projects/tools.titan"><img src=
"../images/titan_transparent.gif" border=
0 width=
105 height=
40 align=
"left" alt=
"Titan"></a></td>
21 <table border=
"0" align=
"right" cellpadding=
"0" cellspacing=
"0">
23 <td><a href=
"../titan_main.html" alt=
"contents"><img border=
"0" src=
"../images/ao.jpg" width=
"53" height=
"40"></a></td>
24 <td><a href=
"../titan_index.html" alt=
"index"><img border=
"0" src=
"../images/up.jpg" width=
"53" height=
"40"></a></td>
25 <td><a alt=
"previous" href=
"int2unichar.html"><img border=
"0" src=
"../images/left.jpg" width=
"53" height=
"40"></a></td>
26 <td><a href=
"interleave.html" alt=
"next"><img border=
"0" src=
"../images/right.jpg" width=
"53" height=
"40"></a></td>
33 <hr align=
"left" width=
"75%">
34 <p>The keyword
<b><font face=
"Courier New">integer
</font></b> denotes a simple basic type whose distinguished values are the positive and negative whole numbers, including zero.
</p>
36 <li>Values of integer type shall be
<a href=
"#double_quotation">denoted by one or more digits
</a>; the first digit shall not be zero unless the value is
0.
</li>
37 <li>The value zero shall be represented by a single zero.
</li>
38 <li>The
<a href=
"#quotation_inside">range of the permitted integer values
</a> may be specified.
</li>
39 <li>The specified
<a href=
"infinity.html#double_quotation">range may be infinite
</a> (both positive and negative; see the keyword
<a href=
"infinity.html"><b><font
40 face=
"Courier New" color=
"#003258" size=
"4">infinity
</font></b></a>).
</li>
41 <li>Another way to limit the permitted integer values is
<a href=
"#list">to list them
</a>.
</li>
42 <li>Value list and value range restrictions
<a href=
"#relation">may be combined
</a></li>
43 <li>Predefined function operating on integer numbers:
</li>
45 <li><a href=
"#str2int">int2float
</a> converts an integer value into a floating point number .
</li>
48 <p>Related keyword:
</p>
50 <li><a href=
"bit2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">bit2int
</font></b></a></li>
51 <li><a href=
"char2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">char2int
</font></b></a></li>
52 <li><a href=
"float2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">float2int
</font></b></a></li>
53 <li><a href=
"hex2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">hex2int
</font></b></a></li>
54 <li><a href=
"infinity.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">infinity
</font></b></a></li>
55 <li><a href=
"int2bit.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2bit
</font></b></a></li>
56 <li><a href=
"int2char.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2char
</font></b></a></li>
57 <li><a href=
"int2float.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2float
</font></b></a></li>
58 <li><a href=
"int2hex.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2hex
</font></b></a></li>
59 <li><a href=
"int2oct.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2oct
</font></b></a></li>
60 <li><a href=
"int2str.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2str
</font></b></a></li>
61 <li><a href=
"int2unichar.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">int2unichar
</font></b></a></li>
62 <li><a href=
"lengthof.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">lengthof
</font></b></a></li>
63 <li><a href=
"oct2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">oct2int
</font></b></a></li>
64 <li><a href=
"regexp.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">regexp
</font></b></a></li>
65 <li><a href=
"sizeof.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">sizeof
</font></b></a></li>
66 <li><a href=
"str2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">str2int
</font></b></a></li>
67 <li><a href=
"substr.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">substr
</font></b></a></li>
68 <li><a href=
"unichar2int.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">unichar2int
</font></b></a></li>
70 <hr align=
"left" width=
"50%">
73 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
76 <h3 align=
"center"><font face=
"Courier New" color=
"#003258" size=
"5"><b>integer
</b></font></h3>
82 <hr align=
"left" width=
"50%">
83 <p><a name=
"double_quotation">Example
1</a>:
84 <p><font face=
"Courier New">var integer v_egeesz :=
65213;
<br>
86 <p>The variable defined is called v_egeesz and has the initial value
65213.
</p>
87 <hr align=
"left" width=
"50%">
88 <p><a name=
"quotation_inside">Example
2</a>:
89 <p><font face=
"Courier New">var integer v_tartomaany (
3 ..
7);
<br>
91 <p>The variable v_tartomaany may have the following values:
3,
4,
5,
6,
7.
</p>
92 <hr align=
"left" width=
"50%">
93 <p><a name=
"list">Example
3</a>:
94 <p><font face=
"Courier New">var integer v_schlagbaum (
12, -
12);
<br>
96 <p>The variable called v_schlagbaum may hold the values
12 and -
12 only .
</p>
97 <hr align=
"left" width=
"50%">
98 <p><a name=
"relation">Example
4</a>:
99 <p><font face=
"Courier New">var integer v_2hataar (
1,
3,
7 ..
9,
11 );
<br>
101 <p>The variable v_2hataar may hold the values
1,
3,
7,
8,
9,
11.
</p>
102 <hr align=
"left" width=
"50%">
103 <p><a name=
"str2int">Example
5</a>:
104 <p><font face=
"Courier New">const float c_csarnoka := int2float (
3);
<br>
106 <p>The constant called c_csarnoka will have the floating point value
3.0.
</p>
107 <hr align=
"left" width=
"25%">
108 <hr align=
"left" width=
"25%">
109 <p align=
"left"><a HREF=
"BNF.html#integerkeyword">BNF definition
</a> of
<font face=
"Courier New">integer
</font><br>
110 <a HREF=
"BNF.html#integervalue">BNF definition
</a> of integer value
</p>