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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
use crate::*;
use crate*;
/// Round a number N up to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->CEILING](https://wiki.documentfoundation.org/Documentation/Calc_Functions/CEILING)
///
/// __Syntax__:
/// ```ods
/// CEILING( N: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign if not 0.
///
/// __Semantics__:
/// Rounds a number up to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical ceiling function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded away from zero to a multiple of the absolute value of Significance
/// and then the sign applied . If Mode is omitted or zero, rounding is toward
/// positive infinity; the number is rounded to the smallest multiple of
/// significance that is equal-to or greater than N. If any of the two
/// parameters N or Significance is zero, the result is zero.
///
/// __Note__:
/// Many application user interfaces have a CEILING function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These CEILING functions are
/// inconsistent with the standard mathematical definition of CEILING.
///
/// __See also__: [crate::of::floor()], [crate::of::int()], [crate::of::ceiling_()], [crate::of::ceiling__()],
/// Round a number N up to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->CEILING](https://wiki.documentfoundation.org/Documentation/Calc_Functions/CEILING)
///
/// __Syntax__:
/// ```ods
/// CEILING( N: Number; Significance: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign if not 0.
///
/// __Semantics__:
/// Rounds a number up to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical ceiling function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded away from zero to a multiple of the absolute value of Significance
/// and then the sign applied . If Mode is omitted or zero, rounding is toward
/// positive infinity; the number is rounded to the smallest multiple of
/// significance that is equal-to or greater than N. If any of the two
/// parameters N or Significance is zero, the result is zero.
///
/// __Note__:
/// Many application user interfaces have a CEILING function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These CEILING functions are
/// inconsistent with the standard mathematical definition of CEILING.
///
/// __See also__: [crate::of::floor()], [crate::of::int()], [crate::of::ceiling()], [crate::of::ceiling__()],
/// Round a number N up to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->CEILING](https://wiki.documentfoundation.org/Documentation/Calc_Functions/CEILING)
///
/// __Syntax__:
/// ```ods
/// CEILING( N: Number; Significance: Number; Mode: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign if not 0.
///
/// __Semantics__:
/// Rounds a number up to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical ceiling function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded away from zero to a multiple of the absolute value of Significance
/// and then the sign applied . If Mode is omitted or zero, rounding is toward
/// positive infinity; the number is rounded to the smallest multiple of
/// significance that is equal-to or greater than N. If any of the two
/// parameters N or Significance is zero, the result is zero.
///
/// __Note__:
/// Many application user interfaces have a CEILING function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These CEILING functions are
/// inconsistent with the standard mathematical definition of CEILING.
///
/// __See also__: [crate::of::floor()], [crate::of::int()], [crate::of::ceiling()], [crate::of::ceiling_()],
/// Rounds a number down to the nearest integer.
///
/// [documentfoundation->INT](https://wiki.documentfoundation.org/Documentation/Calc_Functions/INT)
///
/// __Syntax__:
/// ```ods
/// INT( N: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Returns the nearest integer whose value is less than or equal to N.
/// Rounding is towards negative infinity.
///
/// __See also__: [crate::of::round()], [crate::of::trunc()],
/// Round a number N down to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->FLOOR](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FLOOR)
///
/// __Syntax__:
/// ```ods
/// FLOOR( N: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign.
///
/// __Semantics__:
/// Rounds a number down to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical floor function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded toward zero to a multiple of the absolute value of Significance and
/// then the sign applied . Otherwise, it rounds toward negative infinity, and
/// the result is the largest multiple of Significance that is less than or
/// equal to N. If any of the two parameters N or Significance is zero, the
/// result is zero.
///
/// __Note__:
/// Many application user interfaces have a FLOOR function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These FLOOR functions are
/// inconsistent with the standard mathematical definition of FLOOR.
///
/// __See also__: [crate::of::ceiling()], [crate::of::int()], [crate::of::floor_()], [crate::of::floor__()],
/// Round a number N down to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->FLOOR](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FLOOR)
///
/// __Syntax__:
/// ```ods
/// FLOOR( N: Number; Significance: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign.
///
/// __Semantics__:
/// Rounds a number down to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical floor function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded toward zero to a multiple of the absolute value of Significance and
/// then the sign applied . Otherwise, it rounds toward negative infinity, and
/// the result is the largest multiple of Significance that is less than or
/// equal to N. If any of the two parameters N or Significance is zero, the
/// result is zero.
///
/// __Note__:
/// Many application user interfaces have a FLOOR function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These FLOOR functions are
/// inconsistent with the standard mathematical definition of FLOOR.
///
/// __See also__: [crate::of::ceiling()], [crate::of::int()], [crate::of::floor()], [crate::of::floor__()],
/// Round a number N down to the nearest multiple of the second parameter,
/// significance.
///
/// [documentfoundation->FLOOR](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FLOOR)
///
/// __Syntax__:
/// ```ods
/// FLOOR( N: Number; Significance: Number; Mode: Number )
/// ```
///
/// __Constraints__:
/// Both N and Significance shall be numeric and have the same sign.
///
/// __Semantics__:
/// Rounds a number down to a multiple of the second number. If Significance is
/// omitted or an empty parameter (two consecutive ;; semicolons) it is assumed
/// to be -1 if N is negative and +1 if N is non-negative, making the function
/// act like the normal mathematical floor function if Mode is not given or
/// zero. If Mode is given and not equal to zero, the absolute value of N is
/// rounded toward zero to a multiple of the absolute value of Significance and
/// then the sign applied . Otherwise, it rounds toward negative infinity, and
/// the result is the largest multiple of Significance that is less than or
/// equal to N. If any of the two parameters N or Significance is zero, the
/// result is zero.
///
/// __Note__:
/// Many application user interfaces have a FLOOR function with only two
/// parameters, and somewhat different semantics than given here (e.g., they
/// operate as if there was a non-zero Mode value). These FLOOR functions are
/// inconsistent with the standard mathematical definition of FLOOR.
///
/// __See also__: [crate::of::ceiling()], [crate::of::int()], [crate::of::floor()], [crate::of::floor_()],
/// Rounds the number to given multiple.
///
/// [documentfoundation->MROUND](https://wiki.documentfoundation.org/Documentation/Calc_Functions/MROUND)
///
/// __Syntax__:
/// ```ods
/// MROUND( A: Number; B: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Returns the number X, for which the following holds: X/B = INT(X / B) (B
/// divides X), and for any other Y with the same property, ABS(Y – A) ≥
/// ABS(X - A). In case that two such X exist, the greater one is the result.
/// In less formal language, this function rounds the number A to multiples of
/// B.
///
/// __See also__: [crate::of::abs()], [crate::of::int()], [crate::of::round()],
/// Rounds the value X to the nearest multiple of the power of 10 specified by
/// Digits.
///
/// [documentfoundation->ROUND](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUND)
///
/// __Syntax__:
/// ```ods
/// ROUND( X: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round number X to the precision specified by Digits. The number X is
/// rounded to the nearest power of 10 given by 10 −Digits. If Digits is
/// zero, or absent, round to the nearest decimal integer. If Digits is
/// non-negative, round to the specified number of decimal places. If Digits is
/// negative, round to the left of the decimal point by -Digits places. If X is
/// halfway between the two nearest values, the result shall round away from
/// zero. Note that if X is a Number, and Digits ≤ 0, the results will always
/// be an integer (without a fractional component).
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round_()],
/// Rounds the value X to the nearest multiple of the power of 10 specified by
/// Digits.
///
/// [documentfoundation->ROUND](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUND)
///
/// __Syntax__:
/// ```ods
/// ROUND( X: Number; Digits: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round number X to the precision specified by Digits. The number X is
/// rounded to the nearest power of 10 given by 10 −Digits. If Digits is
/// zero, or absent, round to the nearest decimal integer. If Digits is
/// non-negative, round to the specified number of decimal places. If Digits is
/// negative, round to the left of the decimal point by -Digits places. If X is
/// halfway between the two nearest values, the result shall round away from
/// zero. Note that if X is a Number, and Digits ≤ 0, the results will always
/// be an integer (without a fractional component).
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round()],
/// Rounds the value X towards zero to the number of digits specified by
/// Digits.
///
/// [documentfoundation->ROUNDDOWN](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUNDDOWN)
///
/// __Syntax__:
/// ```ods
/// ROUNDDOWN( X: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round X towards zero, to the precision specified by Digits. The number
/// returned is a multiple of 10−Digits. If Digits is zero, or absent, round
/// to the largest decimal integer whose absolute value is smaller or equal to
/// the absolute value of X. If Digits is positive, round towards zero to the
/// specified number of decimal places. If Digits is negative, round towards
/// zero to the left of the decimal point by -Digits places.
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round()], [crate::of::roundup()], [crate::of::rounddown_()],
/// Rounds the value X towards zero to the number of digits specified by
/// Digits.
///
/// [documentfoundation->ROUNDDOWN](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUNDDOWN)
///
/// __Syntax__:
/// ```ods
/// ROUNDDOWN( X: Number; Digits: Integer )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round X towards zero, to the precision specified by Digits. The number
/// returned is a multiple of 10−Digits. If Digits is zero, or absent, round
/// to the largest decimal integer whose absolute value is smaller or equal to
/// the absolute value of X. If Digits is positive, round towards zero to the
/// specified number of decimal places. If Digits is negative, round towards
/// zero to the left of the decimal point by -Digits places.
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round()], [crate::of::roundup()], [crate::of::rounddown()],
/// Rounds the value X away from zero to the number of digits specified by
/// Digits
///
/// [documentfoundation->ROUNDUP](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUNDUP)
///
/// __Syntax__:
/// ```ods
/// ROUNDUP( X: Number )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round X away from zero, to the precision specified by Digits. The number
/// returned is a multiple of 10−Digits. If Digits is zero, or absent, round
/// to the smallest decimal integer whose absolute value is larger or equal to
/// the absolute value of X. If Digits is positive, round away from zero to the
/// specified number of decimal places. If Digits is negative, round away from
/// zero to the left of the decimal point by -Digits places.
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round()], [crate::of::rounddown()], [crate::of::roundup_()],
/// Rounds the value X away from zero to the number of digits specified by
/// Digits
///
/// [documentfoundation->ROUNDUP](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ROUNDUP)
///
/// __Syntax__:
/// ```ods
/// ROUNDUP( X: Number; Digits: Integer )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Round X away from zero, to the precision specified by Digits. The number
/// returned is a multiple of 10−Digits. If Digits is zero, or absent, round
/// to the smallest decimal integer whose absolute value is larger or equal to
/// the absolute value of X. If Digits is positive, round away from zero to the
/// specified number of decimal places. If Digits is negative, round away from
/// zero to the left of the decimal point by -Digits places.
///
/// __See also__: [crate::of::trunc()], [crate::of::int()], [crate::of::round()], [crate::of::rounddown()], [crate::of::roundup()],
/// Truncate a number to a specified number of digits.
///
/// [documentfoundation->TRUNC](https://wiki.documentfoundation.org/Documentation/Calc_Functions/TRUNC)
///
/// __Syntax__:
/// ```ods
/// TRUNC( A: Number; B: Integer )
/// ```
///
/// __Constraints__:
/// None
///
/// __Semantics__:
/// Truncate number A to the number of digits specified by B. If B is zero, or
/// absent, truncate to an integer. If B is positive, truncate to the specified
/// number of decimal places. If B is negative, truncate to the left of the
/// decimal point.
///
/// __See also__: [crate::of::round()], [crate::of::int()],