| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
<html> |
| 17 |
<head> |
| 18 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 19 |
<meta http-equiv="Content-Language" content="en-us"> |
| 20 |
<title>integer</title> |
| 21 |
</head> |
| 22 |
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> |
| 23 |
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> |
| 24 |
<tr> |
| 25 |
<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> |
| 26 |
</tr> |
| 27 |
</table> |
| 28 |
<table border="0" align="right" cellpadding="0" cellspacing="0"> |
| 29 |
<tr> |
| 30 |
<td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> |
| 31 |
<td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> |
| 32 |
<td><a alt="previous" href="int2unichar.html"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> |
| 33 |
<td><a href="interleave.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> |
| 34 |
</tr> |
| 35 |
</table> |
| 36 |
<p><br clear="all"> |
| 37 |
</p> |
| 38 |
<hr> |
| 39 |
<h1>integer</h1> |
| 40 |
<hr align="left" width="75%"> |
| 41 |
<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> |
| 42 |
<ul> |
| 43 |
<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> |
| 44 |
<li>The value zero shall be represented by a single zero.</li> |
| 45 |
<li>The <a href="#quotation_inside">range of the permitted integer values</a> may be specified.</li> |
| 46 |
<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 |
| 47 |
face="Courier New" color="#003258" size="4">infinity</font></b></a>).</li> |
| 48 |
<li>Another way to limit the permitted integer values is <a href="#list">to list them</a>.</li> |
| 49 |
<li>Value list and value range restrictions <a href="#relation">may be combined</a></li> |
| 50 |
<li>Predefined function operating on integer numbers:</li> |
| 51 |
<ul> |
| 52 |
<li><a href="#str2int">int2float</a> converts an integer value into a floating point number .</li> |
| 53 |
</ul> |
| 54 |
</ul> |
| 55 |
<p>Related keyword:</p> |
| 56 |
<ul> |
| 57 |
<li><a href="bit2int.html"><b><font face="Courier New" color="#003258" size="4">bit2int</font></b></a></li> |
| 58 |
<li><a href="char2int.html"><b><font face="Courier New" color="#003258" size="4">char2int</font></b></a></li> |
| 59 |
<li><a href="float2int.html"><b><font face="Courier New" color="#003258" size="4">float2int</font></b></a></li> |
| 60 |
<li><a href="hex2int.html"><b><font face="Courier New" color="#003258" size="4">hex2int</font></b></a></li> |
| 61 |
<li><a href="infinity.html"><b><font face="Courier New" color="#003258" size="4">infinity</font></b></a></li> |
| 62 |
<li><a href="int2bit.html"><b><font face="Courier New" color="#003258" size="4">int2bit</font></b></a></li> |
| 63 |
<li><a href="int2char.html"><b><font face="Courier New" color="#003258" size="4">int2char</font></b></a></li> |
| 64 |
<li><a href="int2float.html"><b><font face="Courier New" color="#003258" size="4">int2float</font></b></a></li> |
| 65 |
<li><a href="int2hex.html"><b><font face="Courier New" color="#003258" size="4">int2hex</font></b></a></li> |
| 66 |
<li><a href="int2oct.html"><b><font face="Courier New" color="#003258" size="4">int2oct</font></b></a></li> |
| 67 |
<li><a href="int2str.html"><b><font face="Courier New" color="#003258" size="4">int2str</font></b></a></li> |
| 68 |
<li><a href="int2unichar.html"><b><font face="Courier New" color="#003258" size="4">int2unichar</font></b></a></li> |
| 69 |
<li><a href="lengthof.html"><b><font face="Courier New" color="#003258" size="4">lengthof</font></b></a></li> |
| 70 |
<li><a href="oct2int.html"><b><font face="Courier New" color="#003258" size="4">oct2int</font></b></a></li> |
| 71 |
<li><a href="regexp.html"><b><font face="Courier New" color="#003258" size="4">regexp</font></b></a></li> |
| 72 |
<li><a href="sizeof.html"><b><font face="Courier New" color="#003258" size="4">sizeof</font></b></a></li> |
| 73 |
<li><a href="str2int.html"><b><font face="Courier New" color="#003258" size="4">str2int</font></b></a></li> |
| 74 |
<li><a href="substr.html"><b><font face="Courier New" color="#003258" size="4">substr</font></b></a></li> |
| 75 |
<li><a href="unichar2int.html"><b><font face="Courier New" color="#003258" size="4">unichar2int</font></b></a></li> |
| 76 |
</ul> |
| 77 |
<hr align="left" width="50%"> |
| 78 |
<div align="center"> |
| 79 |
<center> |
| 80 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 81 |
<tr> |
| 82 |
<td width="100%"> |
| 83 |
<h3 align="center"><font face="Courier New" color="#003258" size="5"><b>integer</b></font></h3> |
| 84 |
</td> |
| 85 |
</tr> |
| 86 |
</table> |
| 87 |
</center> |
| 88 |
</div> |
| 89 |
<hr align="left" width="50%"> |
| 90 |
<p><a name="double_quotation">Example 1</a>: |
| 91 |
<p><font face="Courier New">var integer v_egeesz := 65213;<br> |
| 92 |
</font> |
| 93 |
<p>The variable defined is called v_egeesz and has the initial value 65213.</p> |
| 94 |
<hr align="left" width="50%"> |
| 95 |
<p><a name="quotation_inside">Example 2</a>: |
| 96 |
<p><font face="Courier New">var integer v_tartomaany (3 .. 7);<br> |
| 97 |
</font> |
| 98 |
<p>The variable v_tartomaany may have the following values: 3, 4, 5, 6, 7.</p> |
| 99 |
<hr align="left" width="50%"> |
| 100 |
<p><a name="list">Example 3</a>: |
| 101 |
<p><font face="Courier New">var integer v_schlagbaum (12, -12);<br> |
| 102 |
</font> |
| 103 |
<p>The variable called v_schlagbaum may hold the values 12 and -12 only .</p> |
| 104 |
<hr align="left" width="50%"> |
| 105 |
<p><a name="relation">Example 4</a>: |
| 106 |
<p><font face="Courier New">var integer v_2hataar ( 1, 3, 7 .. 9, 11 );<br> |
| 107 |
</font> |
| 108 |
<p>The variable v_2hataar may hold the values 1, 3, 7, 8, 9, 11.</p> |
| 109 |
<hr align="left" width="50%"> |
| 110 |
<p><a name="str2int">Example 5</a>: |
| 111 |
<p><font face="Courier New">const float c_csarnoka := int2float (3);<br> |
| 112 |
</font> |
| 113 |
<p>The constant called c_csarnoka will have the floating point value 3.0.</p> |
| 114 |
<hr align="left" width="25%"> |
| 115 |
<hr align="left" width="25%"> |
| 116 |
<p align="left"><a HREF="BNF.html#integerkeyword">BNF definition</a> of <font face="Courier New">integer</font><br> |
| 117 |
<a HREF="BNF.html#integervalue">BNF definition</a> of integer value</p> |
| 118 |
</body> |
| 119 |
</html> |