Download AOS Library User`s Manual
Transcript
Library User's Manual
~
%hA Integer Conversion unit
The integer conversion unit (named Num_Con) contains routines
capable of translating integers between numerical and character
string representations. Commonly used numerical functions are also
provided.
The integer conversion unit provides the following capabilities:
String-to-integer and integer-to-string conversion.
Integer min and max functions.
Unsigned integer comparison operators.
Section 4.0.0 presents concepts needed for using the integer
conversion unit. Section 4.0.1 provides a detailed description of
each· function.
Section 4.0.2 displays the text comprising the
integer conversion ~nit's interface section.
Section 4.0.3 contains a programming example.
4.0.0 Integers
An·integer is defined as a whole number in the range -32768 •• 32767.
Integers are stored as two's complement binary values in variables
of type integer. Values stored in this fashion are referred to as
numerical integers. Integers can also be stored as character
strings in variables of type string. Values stored in this fashion
are referred to as character string integers.
Character string
integers have the following form:
<integer) ::= <sign) <digit) {<digit)}
-
<sign)
::= [ +
<digit)
::= 0
1
5
6
]
2
7
3
8
4
9
Examples of character string integers:
-32768
+1
1
o
16
4.0.0.0 Unsigned Integers
Unsigned integers are defined to contain values in the range
0 •• 65535. They are represented as 16-bit binary values and are
stored in variables of type integer.
They differ from Signed
integers only in use and interpretation. They are identical in the
Page
48