basic.arithmetic.expressions

Definition/BASIC Program, Releases: AP and R83

Arithmetic expressions.

Description

perform mathematical calculations on any set of operand expressions.

Symbol precedence operation
^ 1 exponentiation
* 2 multiplication
/ 2 division
\ 2 remainder
+ 3 addition
- 3 subtraction

Expressions are evaluated in order of precedence unless placed within parentheses.

Expressions at the same precedence evaluate left-to-right:

10+2*10 evaluates to 30.

Expressions within the innermost parentheses are evaluated first:

(10+2)*10 evaluates to 120.
(10+(2*10)) evaluates to 30.

See Also

Command Name Type Description
basic.logical.expressions Definition application of logical (Boolean) operators to relational or arithmetic expressions.
basic.precedence Definition Precedence of compound expressions.
string.expressions Definition A string of characters.
basic.operators Relational Operator Operators * ! & = # - + / ^ < > \ [ ] ( )
arithmetic.operators Definition add, subtract, multiply, and divide numeric operands in arithmetic expressions.
basic.- Operator Mathematical operator (subtract). Also unary minus.
basic.*= Assignment Operator Multiplies numeric expression and assigns to variable.
basic.+= Assignment Operator Adds numeric expression and assigns to variable.
basic.-= Assignment Operator Subtracts numeric expression and assigns to variable.
basic./= Assignment Operator Divides numeric expression and assigns to variable.
basic.:= Assignment Operator Concatenates expression and assigns to variable.
basic.( Reserved Character used to surround arguments within functions, or to enclose subscript refererences within dimensioned arrays. It is also used to override the normal order of precedence evaluation.
basic.) Reserved Character surrounds arguments within functions, encloses subscript refererences within dimensioned arrays, and overrides the normal order of precedence evaluation.
basic.+ Operator Arithmetic operator (add). Also unary plus.
basic.*.multiply Operator Arithmetic multiply operator

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.