-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, Apr 20, 2008 at 12:07:31PM -0700, James Newton wrote: > Why don't we start thinking about dates in terms of scientific notation? In > other words, we don't need to keep track of ranges of time longer than our > current precision, but when we set an arbitrary starting point, and use a > number system that doesn't include an exponent, eventually it has to fail. > Why not use a mantissa and exponent for the year or over all date? > > Then you can represent dates +/- the precision of the mantissa centered on > the year with exponent. In general, why bother? A 64-bit signed integer, with 1 second resolution, gives you 292 billion years before and after the epoch. I'd hate to think that we'd be still remembering the 70's until well after the sun has blown up. If that's not enough, just upgrade to 256-bit resolution, which has enough bits to encompase Wikipedia's "Orders of Magnitude (time)" section from Planck time, 10^-44, to 10^11 (closed universe total lifetime) with another 14-odd digits to spare. That said, from a real world implementation perspective, go for it. Modern computers add 64-bit floating point doubles in one clock cycle just like 64-bit integers. There is precedence as well, Python for instance uses floats for everything time related, time() returns the usual seconds since 1970 and as much fractional seconds of resolution as the OS provides, microseconds on Linux for instance. My Tuke EDA toolkit I'm writing uses standard 64-bit floats to store all dimension data. Most EDA tools I know of tend to store geometry data in integers, gEDA for instance has a 1 micron resolution, but I figured it'd be easier just to use floats given that most math and geometry libraries expect them. Besides, it's fun to think that with meters as my underlying unit %99.99 of designs will never have a dimension be more than 1.0 internally. - -- http://petertodd.org 'peter'[:-1]@petertodd.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIC+0Q3bMhDbI9xWQRAqcVAJ4uIR9F3FLJdQnRrFc9CNRMcHtZxQCePvzw PICRrReqNCGKi8Tbzsp7M0Y= =cjTD -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist