78 Chapter 5. Datatypes
OperationNumber of argsResulting type
AND 2 Boolean
OR 2 Boolean
NOT 1 Boolean
= 2 Boolean
5.2.2
An element of theCharacter datatypetake the following kinds of values:
Alphabet: Capital letters A,B,...,Z or small letters a,b,...,z
Numeral: Digits 0,1,...,9
Special characters: Separators like blank, comma, fullstop, semicolon,
colon, hyphen, underscore, slash, backslash, exclamation mark, question
mark; other special characters like $,#, %, @, ...
The only operation that makes sense for characters is check for equality, which
returns Boolean.
OperationNumber of argsResulting type
= 2 Boolean
5.2.3
AnInteger datatypeelement take the values ...,-3,-2,-1,0,1,2,3,... (i.e. the integer
can be a negative number, zero or a positive number.
We can add, subtract, multiply integers. We can also compare two integers. It may
or may not be possible to divide one integer by another, unless we dene a special
integer operation that takes only the quotient after division. These operations are
shown in the table below:
OperationNumber of argsResulting type
+ 2 Integer
2 Integer
2 Integer
2 Integer
= 2 Boolean
> 2 Boolean
< 2 Boolean