Expressions can be entered using a C-like syntax.
The interpreter understands the following operators:
In the above, N and M are either sub-expressions or constants.
- N ; M
- Add all numbers in the current column from row N to row M.
- N : M
- Add all numbers in the current row from column N
to column M.
- N , M
- Get the value from the cell in row N, column M.
- N || M
- Logical OR of N and M.
- N && M
- Logical AND of N and M.
- N | M
- Bitwise OR of N and M.
- N ^ M
- Bitwise XOR of N and M.
- N & M
- Bitwise AND of N and M.
- N == M
- 1 if N equals M, 0 otherwise.
- N != M
- 1 if N is not equal to M, 0 otherwise.
- N < M
- 1 if N is less than M, 0 otherwise.
- N <= M
- 1 if N is less than or equal to M, 0 otherwise.
- N > M
- 1 if N is greater than M, 0 otherwise.
- N >= M
- 1 if N is greater than or equal to M, 0 otherwise.
- N >> M
- N shifted right M steps.
- N << M
- N shifted left M steps.
- N + M
- N - M
- N * M
- N / M
- N \ M
- Integer division, i.e. the remainder is thrown away.
- N % M
- N ** M
- Logical NOT of N.
- Bitwise NOT of N.
can be hexadecimal numbers starting with 0x, octal numbers starting with
0 or floating-point numbers with or without decimal point and exponent.
Numbers starting with a single 0 immediately followed by a decimal
point are interpreted as floating point numbers.
Operators are evaluated in the following order:
Parentheses can be used to group sub-expressions and to override the
standard evaluation order.
- Unary + - ! ~
- ** \
- * / %
- + -
- == !=
- ; : ,
The characters R and C can be used to denote the current row and
The expressions can contain white space and /* C-style comments */.
In addition to the comma notation above, cells can be referred to
using R1C1 or A1 notation. The reference style is changed using
the Window - Reference Style menu entry.
References are automatically updated when lines and columns are
inserted or removed.
Certain functions can handle not only numbers and references, but whole
ranges of cells. Such ranges are written as, for example, a1..c2.
In this case,
the range consists of all cells from row 1, column 1 to row 2, column 3
(6 cells altogether). Not all functions can handle ranges.
Ranges update when lines and columns are inserted or deleted, just
like the references described above.
Variables can be assigned from the interpreter in the following way:
where name is the name of the variable and value is a numeric constant,
another variable, a cell reference or an expression.
Variables assigned in the interpreter can also be used from SIOD,
and any variable known by the SIOD interpreter is also available here.
All functions known by the SIOD interpreter can also be called from the
C interpreter by writing the call as:
The arguments can be constants, cell references or numeric variables
known by the SIOD interpreter. The arguments can also themselves be
Reference list of available functions
More information on the Scheme interpreter
- The constant 123.4
- This evaluates to 0
- Exclusive or of 2 and 3, i.e. 1.
- 2 raised to the power of 3, i.e. 8.
- Evaluates to 3.6.
- Evaluates to 3.
- The contents of the cell in row 3, column 4
- The same in r1c1 notation
- The same in a1 notation
- r, c-1
- The contents of the cell immediately to the left of the current
- The sum of the cells in the current column from row 2 to the
row immediately above the current cell
- The sum of the cells to the left and above the current cell.
The parentheses are necessary because '+' would otherwise
be evaluated before ','
- The sum of the value in row 2, column 3 and the value in
row 2, column 4
- Same as above in A1 reference style
- Arc cosine of the value in row 3, column 1
- Tangent of r2c2.
- Also tangent of r2c2. Function calls can be part of expressions
- pow(temp, 0.25)
- The variable temp raised to the power of 1/4
- pow(temp, 1/4)
- In this example, sin(1.59) is an expression
- define(pi, 3.14)
- Define a useful variable
- r_sum(r2c2..r5c6, r1c1, 12)
- The sum of all numbers between row 2, column 2 and row 5,
column 6; the number in row 1, column 1; and the number 12.
Ulric Eriksson - July 2000 - email@example.com