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

 


Help: OASIS Mailing Lists Help | MarkMail Help

oic message

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


Subject: RE: [oic] TIME function in ODF vs OOXML


Re: Andreas - Yes, if I had actually plugged numbers into the formula rather than examining it by sight, I'd have seen I get "2".  I'll pursue documenting our difference.

I still think there is value to considering allowing for - or at least identifying the possibility of encountering - both in the text of the standard.  Primarily since the modus operandi of the formula SC was to arrive at something that agreed with all the core implementations, and there are a couple that do it one way and a couple that do it another.  That's ODF TC, though; I agree the interop advisory is the right thing for OIC.

John

-----Original Message-----
From: oic@lists.oasis-open.org [mailto:oic@lists.oasis-open.org] On Behalf Of Dennis E. Hamilton
Sent: Tuesday, May 22, 2012 3:21 PM
To: oic@lists.oasis-open.org
Subject: RE: [oic] TIME function in ODF vs OOXML

I think Part 2 sections 4.3.2-4.3.4 all need work.

There are also 4.11.3 and 4.11.4 to consider.

Section 6.3.16 doesn't seem to be much help.

I think 6.10.17 is extremely clear compared to those listed above.  Unfortunately, when it talks about Time as a subtype, it needs to be squared with the definitions in other sections too.  Of course, being a fractional day does not mean being less than 1.  But "fraction of the day" is unfortunately not explicit enough in light of the other too-casual definitions.  It could be taken to mean that the result is the DayFraction (see 6.10.16), but it doesn't say that unambiguously.

I checked a spreadsheet I carried about issues that were being handled in the wrap-up of 1.2 and I found nothing on 6.10.17 or TIME that applied to OpenFormula.  I did a crude search of JIRA and found nothing either.  I can't claim this as comprehensive, though.

The oldest draft for OpenFormula that I have is dated 2007-11-15.  There is an interesting statement that somehow disappeared into history, that it considers that time can be a fractional representation for a time of day or for a duration.  However, statements about dates plus times being DateTime values suggest that durations of one day or longer are overlooked or not considered.  (The statement about DateTime is also a problem for negative values for date numbers.)

It is stated the TimeParam is for a fraction of a day and will be converted as such if necessary.  However, the "Conversion to TimeParam" is the same as in ODF 1.2.

In that older text about TIME (6.9.16 then, 6.10.17 now) everything is the same except for these last two paragraphs.  The test cases (not included in ODF 1.2 demonstrate minutes and seconds outside of range and even being negative but still retained in the calculation.

Here are some important distinctions that were lost at some point:

   Time is a subtype of number, where a time value of 1 = 1 day = 
   24 hours. Note that the time inside one day is a fraction between 
   0 and 1, so typical implementations will only be able to compute 
   approximations of the correct time value.

   Implementations may first perform INT() on the hour, minute, and 
   second before doing the calculation. Therefore, only integer values 
   are portable between implementations. Hours, minutes, and seconds 
   may be arbitrary numbers (they must not be limited to the ranges 
   0..24, 0..59, or 0..60 respectively).

   Note that in typical implementations, a value displayed as time 
   has its integer portion discarded and then time is computed; for 
   computational purposes, though, the entire value is retained.

It would be interesting to know when this changed, and why.

 - Dennis


-----Original Message-----
From: oic@lists.oasis-open.org [mailto:oic@lists.oasis-open.org] On Behalf Of Andreas J. Guelzow
Sent: Tuesday, May 22, 2012 13:35
To: oic@lists.oasis-open.org
Subject: RE: [oic] TIME function in ODF vs OOXML

Hi,

On Tue, 2012-05-22 at 12:50 -0600, John Haug wrote:
> However, in reading what ODF says about TIME, I’m not convinced what 
> the right answer is – it’s underspecified.
> 
>  
> 
> The relevant parts of 6.10.17 TIME are (ODF 1.2):
> 
> Semantics: Returns the fraction of the day consumed by the given time,
> i.e.: ((hours*60*60)+(minutes*60)+seconds)/(24*60*60)

> “Returns the fraction of the day” seems to imply the number should be 
> a fractional value of 1.  The definition of “Time” doesn’t help any.
> The entirety of 4.3.2 Time is:

Looking only at the first half the semantics description one could possibly argue that it is underspecified, but the second part (i.e. == "id est" == "that is") gives a mathematical formula for the values which specifies the return value completely. The whole point of including the formula is to avoid issue with arguing what a "fraction of the day consumed by the given time" is. 

> 
> My understanding is that the intent of the formula subcommittee was to 
> create something compatible with in-market implementations as much as 
> possible, so I’d think that if this had been found before 1.2 was 
> completed it probably would have defined specific results for values 
> between 0 and 24 hours and then left values larger than 24 hours 
> implementation dependent.  Hopefully with some comment about some 
> implementations using a modulo and others simply dividing.

I believe the whole point of the public review is that implementors could point out issue such as this. Unfortunately nobody did (and especially whoever decided to change the openoffice.org/Apache OpenOffice implementation should have raised this issue with the TC.

> That seems the best thing to do, to me.  Interop advisory, bug fix in 
> ODF?

That really would not be a bug fix but a incompatible change. The semantics given in ODF 1.2 gives a mathematical expression for the return value that does not permit two interpretations, especially since it is noted that the hour/minute/second values are not restricted so teh formula will give values outside of the 0 to 1 range.

Andreas


--
Andreas J. Guelzow, PhD, FTICA
Concordia University College of Alberta


---------------------------------------------------------------------
To unsubscribe, e-mail: oic-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: oic-help@lists.oasis-open.org




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