[R] timeDate

Martin Maechler maechler at stat.math.ethz.ch
Tue Nov 23 17:30:35 CET 2004


>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch>
>>>>>     on Tue, 23 Nov 2004 17:04:41 +0100 writes:

>>>>> "james" == james holtman <james.holtman at convergys.com>
>>>>>     on Tue, 23 Nov 2004 10:39:04 -0500 writes:

    james> You might want to check out 'chron'.  This stores the
    james> time as days and fractions of a day.

    james> If you take the current date,

    >>> as.numeric(chron(dates.="11/23/2004"))
    james> [1] 12745
    >>> 

    james> you get the value above.  If you change this to
    james> millisecond, you get

    >>> as.numeric(chron(dates.="11/23/2004")) * 86400 * 1000
    james> [1] 1.101168e+12
    >>> 

    james> this value requires 46 bits and since a floating
    james> point number has 54 bits of value, 

    MM> no, only 52 bits  (64 = 52+1+12+1) with sign bits for exponent
    MM> and mantissa.

so much on the theme of mathematicians and arithmetic !
   64 = 52 + 1 + 10 + 1

Martin




More information about the R-help mailing list