1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
//!
//! Basic operators as functions.
//!
use crate::;
/// Adds two numbers.
///
/// __Syntax__:
/// ```ods
/// Number Left + Number Right
/// ```
///
/// __Returns__: Number
///
/// __Constraints__: None
///
/// __Semantics__: Adds numbers together.
///
/// __See also__ postfix add() and as operator +.
/// Subtracts two numbers.
///
/// __Syntax__:
/// ```ods
/// Number Left - Number Right
/// ```
///
/// __Returns__: Number
///
/// __Constraints__: None
///
/// __Semantics__: Subtracts two numbers .
///
/// __See also__ postfix sub() and as operator -.
/// Multiplies to numbers.
///
/// Syntax:
/// ```ods
/// Number Left * Number Right
/// ```
///
/// Returns: Number
///
/// Constraints: None
///
/// Semantics: Multiplies numbers together.
///
/// See also postfix mul() and as operator *;
/// Divides to numbers. Also available as postfix div() and as operator /.
///
/// Syntax:
/// ```ods
/// Number Left / Number Right
/// ```
///
/// Returns: Number
///
/// Constraints: None
///
/// Semantics: Divides numbers. Dividing by zero returns an Error.
///
/// See also postfix div() and as operator /.
/// Exponential function.
///
/// Syntax:
/// ```ods
/// Number Left ^ Number Right
/// ```
///
/// Returns: Number
///
/// Constraints: NOT(AND(Left=0; Right=0)); Evaluators may evaluate expressions where
/// OR(Left != 0; Right != 0) evaluates to a non-Error value.
///
/// Semantics: Returns POWER(Left, Right).
///
/// See also postfix pow() and as operator ^.
/// Negates as number. Also available as prefix operator -.
/// percentage. Also available as postfix percent()
/// Concatenate two strings.
///
/// Syntax:
/// ```ods
/// Text Left & Text Right
/// ```
///
/// Returns: Text
///
/// Constraints: None
///
/// Semantics: Concatenates two text (string) values.
///
/// Note: The infix operator “&” is equivalent to CONCATENATE(Left,Right).
///
/// See also postfix concat() and as operator &.
/// Compute the intersection of two references
///
/// __Syntax__:
/// ```ods
/// Reference Left ! Reference Right
/// ```
///
/// __Returns__: Reference
///
/// __Constraints__: None
///
/// __Semantics__: Takes two references and computes the intersection - a reference to the intersection
/// of cells in both Left and Right. If there are no cells in common, returns an Error.
/// If Left or Right are not of type Reference or ReferenceList, an Error shall be returned.
/// If Left and/or Right are reference lists (result of infix operator reference concatenation), the
/// intersection is computed for each combination of Left and Right, producing a reference list of
/// intersections.
///
/// __Note 1__: For example (a,b,c,d denoting one reference each):
/// (a~b)!(c~d) will compute (a!c)~(a!d)~(b!c)~(b!d)
///
/// If for a resulting intersection there are no cells in common, the element is ignored and omitted
/// from the result list. If for all intersections there are no cells in common and the result list is empty,
/// an Error is returned.
///
/// __Note 2__: Intersection is notated as "!" in OpenFormula format, but as a space character in some
/// user interfaces.
///
/// __See also__ Infix Operator Reference Union 6.4.13
/// Concatenate two references
///
/// Syntax:
/// ```ods
/// Reference Left ~ Reference Right
/// ```
///
/// Returns: ReferenceList
///
/// Constraints: None
///
/// Semantics: Takes two references and computes the "cell union", which is a concatenation of the
/// reference Left followed by the reference Right. This is not the same as a union in set theory;
/// duplicate references to cells are not removed. The resulting reference will have the number of
/// areas, as reported by AREAS, as AREAS(Left)+AREAS(Right).
///
/// Note: Concatenation is notated as "~" in OpenFormula format, but as a comma or “+” in some
/// user interfaces.
///
/// If Left or Right are not of type Reference or ReferenceList, an Error shall be returned.
///
/// See also