[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [office-comment] Error in FLOOR function specification
I don't understand the statement that the result is undefined when x and p have opposite signs. Since we're talking about *integer* multiples, it is completely well-defined to say that floor(x,p) is the largest multiple of p not greater than x so long as p is not zero. It may be that the multiplier has different sign than p to make this happen, and that is already the case for floor(-12.5,1) which I have not seen any objection to. It may be that some library functions are defined with that case undefined, but there is no mathematical reason for it. - Dennis PS: It does not matter whether I believe the statement in the OpenFormula text is in error or not. I am not on the ODF TC and not the one to make any repairs to the specification (although sometimes my advice is useful to the TC). The way to see what the ODF TC is making of this is to see what happens when a JIRA issue on your comment is created. The JIRA is viewable by the public at <https://issues.oasis-open.org/browse/OFFICE/>. -----Original Message----- From: cowan@ccil.org [mailto:cowan@ccil.org] Sent: Tuesday, February 24, 2015 06:38 To: dennis.hamilton@acm.org Cc: 'Joel'; office-comment@lists.oasis-open.org Subject: RE: [office-comment] Error in FLOOR function specification Dennis Hamilton scripsit: [ ... ] > In particular, floor(x) is the largest integer not greater than x, > ceiling(x) is the smallest integer not less than x. Similarly, floor(x,p) > is the largest integer multiple of p not greater than x and ceiling(x,p) > is the smallest integer multiple of p not less than x. That's the way it should be defined, yes. But when x and p have opposite signs, the result is undefined, and the standard needs to take that into account. [ ... ] Now arguably it would be better to rewrite floor and ceiling completely to provide the mathematical definition, and then provide exception clauses for the p = 0 (same as p = 1 for positive x and p = -1 for negative x) and opposite-sign cases. But in the meantime, the existing definition of floor is wrong as written, and that can be fixed by replacing "away from zero" with "toward zero". Please take the time to convince yourself that this is true. -- John Cowan http://www.ccil.org/~cowan cowan@ccil.org In computer science, we stand on each other's feet. --Brian K. Reid -- This publicly archived list offers a means to provide input to the OASIS Open Document Format for Office Applications (OpenDocument) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: office-comment-subscribe@lists.oasis-open.org Unsubscribe: office-comment-unsubscribe@lists.oasis-open.org List help: office-comment-help@lists.oasis-open.org List archive: http://lists.oasis-open.org/archives/office-comment/ Feedback License: http://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: http://www.oasis-open.org/maillists/guidelines.php Committee: http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office Join OASIS: http://www.oasis-open.org/join/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]