Operators

Unlike other spread sheets, the operators in teapot check the type of the values they are applied to, which means the try to add a string to a floating point number will result in an type error. The following operators are available, listed in ascending precendence:

x<y
evaluates to 1 if x is less than y. If x or y are empty, they are considered to be 0 if the other is an integer number, 0.0 if it is a floating point number and the empty string if it is a string.
x<=y
evaluates to 1 if x is less than or equal to y.
x>=y
evaluates to 1 if x is greater than or equal to y.
x>y
evaluates to 1 if x is greater than y.
x==y
evaluates to 1 if x is equal to y.
x=y
evaluates to 1 if the floating point value x is almost equal to the floating point value y. Almost equal means, the numbers are at most neighbours.
x!=y
evaluates to 1 if x is not equal to y.
x+y
evaluates to the sum if x and y are numbers. If x and y are strings, the result is the concatenated string. There is no dedicated logical OR operation, so use + for that.
x-y
evaluates to the difference if x and y are numbers.
x*y
evaluates to the product if x and y are numbers. There is no dedicated logical AND operation, so use * for that.
x/y
evaluates to the quotient if x and y are numbers.
x%y
evaluates to the remainder of the division if x and y are numbers.
x^y
evaluates to x to the power of y.
-x
evaluates to -x if x is a number. If x is empty, the result will be empty, too.
(expression)
evaluates to the expression.
function(argument,...)
evaluates to the value of the function applied to the values resulting from evaluating the argument expressions.