Specifications
Concepts - 9
error message. Subsequent lines will become garbled as the synchronous nature of data transmission
is lost.
When numeric constants are printed in a program listing, they are always followed by a space. The space is added by the
LIST statement and is not stored in your program.
OPERATORS
Arithmetic Operators:
CAMBASIC is capable of manipulating single bits within an 8–bit field, packed BCD data, 8–bit bytes, 16–bit words, and
real (floating point) numbers.
CAMBASIC assumes that all numbers contained in a program and those input by the operator are decimal. It can also
accept hexadecimal numbers. The prefix of the number determines its modulus. For example,
Decimal 33797 (no prefix needed)
Hexadecimal &8405 (& means hexadecimal)
Binary @11001001 (@ means binary)
The output can be in decimal, hexadecimal or binary format:
Decimal 242
Hexadecimal E2
Additional math operators are:
Operator Operation Example
+ addition X+Y
– subtraction X–Y
* multiplication X*Y
/ division X/Y
\ integer division X\Y
mod modulo X mod Y
Expression analysis of multiplication and division is carried out first from left to right. Then addition and subtraction are
evaluated from left to right.
NOTE: Values for X and Y cannot exceed 32767 or be less than –32768 when performing integer division.
If these values are exceeded, overflow will occur, data will be erroneous and no error message will be
generated.
Relational Operators
Operator Relation Example
Tested
= equal X=Y
<> not equal X<>Y










