Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed title to "BBC BASIC Operators"

The following operators may be used as part of expressions.

Arithmetic operators

The arithmetic operators take two numbers as operands.

+add -subtract
*multiply /divide
^raise to the power   

Relational operators

The relational operators can compare numbers, and return a logical value of FALSE=O and TRUE=-1.

less than =equal to
<=less than or equal to >greater than
<>not equal to >=greater than or equal to

Logical operators

The logical operators operate on numeric or logical values. Boolean FALSE is taken as zero, TRUE as —1.

Indirection operators

The following operators allow the programmer to access memory directly (called PEEK in other versions of BASIC) or to alter the contents of specified memory locations (called POKE in other BASICs).

...

Individual characters can be accessed with the ? operator.

Order of precedence

The order of precedence of the operators is as follows:

...