The operators specify what type of actions are performed on arguments
(operands) in the formula. HyperFormula supports the operators that
are common in spreadsheet software. They are calculated in a
specific order which can be altered by
the use of parentheses.
The unary operators have only one argument (operand). For example,
when the unary negation operation is provided with a number, it
returns the negative value of that number.
The binary arithmetic operators enable the computation of basic
mathematical operations. They don’t have to be wrapped with any
functions. This table shows the basic behavior of the binary
arithmetic operators:
Operator
Meaning
Example
Description
+
Addition
a + b
Add the two arguments.
-
Subtraction
a - b
Subtract the second argument from the first argument.
*
Multiplication
a * b
Multiply the two arguments.
/
Division
a / b
Divide the first argument by the second argument.
^
Exponentiation
a ^ b
Raise the first argument by the power of the second argument.
You are probably wondering why the modulo operator is missing.
It is supported by the function MOD so instead of writing a % b,
as you would in a regular mathematical equation, you use a formula like this: =MOD(a, b).
HyperFormula does type coercion and it can have an impact on comparing,
adding, or any other operation between values of a different type.
The tables represent some operations between different types and
their results.
Boolean to int coercion, basic arithmetic operations
By default, HyperFormula is case and accent insensitive. This means
it will ignore upper and lower-case letters and accents during the
comparison. For example, if you compare AsTrOnAuT with aStroNaut
they will be understood as identical, the same goes for Préservation
and Preservation. It applies to comparison operators only. It can be
configured with accentSensitive and caseSensitive options in the
configuration.
Apart from accents and case sensitivity, you can also configure
caseFirst. This option defines whether upper case or lower case should come first. Additionally the ignorePunctuation option specifies whether punctuation
should be ignored in string comparison. By default caseFirst is set
to 'lower' and ignorePunctuation is set to false. For more details
see the official API reference of HyperFormula.
Here is an example configuration that overwrites default settings: