Re: Time of course

Ethan Alpert wrote:

>My confusion stems from not understanding how you plan to use the 52 bit IEEE
>mantissa as a 52 bit integer. I understand that you simply have to use the
>LSB to advance the time counter but how are you going to disable the floating 
>point of the machine, so as to prevent the machine from using the exponent part
>of the IEEE double. 

Conversion between a double and an integral value is exact as long as
the integral value can be exactly represented in a double.  There is no
need to type-pun or explicitly modify the LSB.  As an example, note
that the following program prints "yes" after incrementing a double
value one million times:

        main()
        {
                long    n       = 1000000;
                double  d       = 0;

                while (d < n)
                        ++d;
                (void) puts(d == n ? "yes" : "no");
        }

We need only concern ourselves with integral values because we can
choose the "units" attributes such that only integral values are
necessary.

>Finally, if I want to select the first 10 milliseconds of June 1st for
>a ten year period from within my own application how would I do this.
>The conversion from the floating point representation would appear to
>be kind of mind twisting,

I intend to enhance the UDUNITS package so that it can be used for
this.  My beliefs are that this approach (i.e. only dealing with the
"units" attributes") will be less burdensome on the programmer than
having to potentially handle multi-component base variables
everywhere, and that it will be sufficient for all but extremely
specialized datasets.

>when taking into account leap years and irregular month spacing. How will 
>generic applications handle this?

A generic application should only concern itself with the units and
origins of coordinate variables.  Time would be handled just like any
other dimension.

>Can a conversion utility library 
>be developed to handle this? 

I'm working on it.

--Steve


  • 1992 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: