OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

# office-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [office-comment] Error in FLOOR function specification

• From: Regina Henschel <rb.henschel@t-online.de>
• To: office-comment@lists.oasis-open.org
• Date: Tue, 24 Feb 2015 20:48:35 +0100

```Hi Joel,

```
I think, that you are right. The mode has been introduced to get a function, which is compatible to Excels "floor". Excels "floor" rounds toward zero. LibreOffice and Apache OpenOffice round toward zero as well, if mode<>zero. Gnumeric exports this case to floor(number;significance;1) when saving to ODF and rounds toward zero as Excel does.
```
I have created issue https://issues.oasis-open.org/browse/OFFICE-3879.

Kind regards
Regina

Joel schrieb:
```
```Hello Committee Members,

I recently came across the OpenDocument 1.2 specification for the
FLOOR function (section 6.17.3), and I believe there is a small error
in the definition
that is deserving of some errata for clarity.  It reads as follows:

...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 . Otherwise, it rounds toward
negative infinity, and the result is the largest multiple...

I believe that "away from zero" is a typo, and should be "toward
zero".  Compare to the CEILING (6.17.1) function definition:

...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...

Note that the FLOOR function, which should be the opposite of CEILING,
correctly specifies negative instead of positive infinity, but still
has "away from zero" like CEILING, when I believe it should be the
opposite.

An additional proposal: the FLOOR function language should be
conformed to the CEILING language, which I believe is clearer.
Namely, replace "Otherwise, it rounds toward negative infinity, and
the result is the largest multiple..." with "...If mode is ommitted or
zero, rounding is toward negative infinity; the number is rounded to
the largest multiple...".

```