[Bug 4856] [FO11] arithmetic on durations

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4856





--- Comment #13 from Michael Kay <mike@saxonica.com>  2009-04-28 11:17:13 ---
PROPOSAL (ACTION A-392-10):

(a) Define (duration * number) and (duration div number) to work on all
durations, not only the two subtypes as at present. The semantics are defined
by splitting the duration into a yMD and a dTD, then applying the current
operator, then recombining the results.

The results may be a little idiosyncratic in the case where the number is not
an integer, but it's perfectly well-defined and there are many cases where it's
useful.

(b) Define (D +|- duration) for all durations (not only the two subtypes) where
D is a date or dateTime. The semantics are defined by splitting duration into a
yMD and a dTD and then taking (D +|- yMD +|- dTD). This is well-defined over
all durations.

(c) Define (T +|- duration) where T is an xs:time for all durations (not only
for dTD). The number of years/months in the duration is ignored, just as the
number of days is currently ignored.

(d) Define (duration +|- duration) for all durations, but returning a dynamic
error for certain combinations of operands. Specifically, the two durations are
decomposed into yMD and dTD; the two components are independently added and
subtracted; if the two partial-results have the same sign, they are combined
together to form the result; if they have opposite sign, the result is a
dynamic error.

(Note: there are a number of ways we could implement this proposal, depending
how much we want to change the op: functions.)


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 28 April 2009 11:17:22 UTC