comp.lang.ada
 help / color / mirror / Atom feed
From: Charles Hixson <charleshixson@earthling.net>
Subject: Re: Calling C time function from ADA-95
Date: 1998/06/09
Date: 1998-06-09T00:00:00+00:00	[thread overview]
Message-ID: <357DA2E1.704E9A16@earthling.net> (raw)
In-Reply-To: 357D6F53.46486039@cl.cam.ac.uk


Sure, it could easily be based on floating point numbers.  And yes, I
can write my own calendar package.  Everybody seems to end up needing to
write their own calendar.  But doesn't that sort of defeat the purpose
of a system library?  Everyone could write their own sine_table package,
too, but the system routine, being good enough, almost nobody does.  If
people are needing to re-implement the calendar, then that's a sign that
the calendar package ... well, broken usually means something else.

Markus Kuhn wrote:
> 
> Charles Hixson wrote:
> > I think that times should be kept on a kind of sliding scale.  Say
> > seconds for the current decade, minutes for the current century, hours
> > for the current 100 centuries.  Days for the current 10,000 centuries.
> > Etc.
> 
> That sounds like a revolutionary new concept, but somehow I remember
> having heard one of our Computer Science professors telling us already
> about such advanced mechanisms for representing scalar values.
> Isn't this stuff called "floating point numbers" or so?  :-)
> 
> > That should be sufficient overkill for ANYONE that would be
> > satisfied by the current date structure anyway.
> 
> Just use a 64-bit integer counter for the seconds since some epoch,
> which will last for the next 290 billion years (and goes backwards
> far beyond the big bang). Add a 32-bit counter with the number
> of nanoseconds since the last second started, and you get a
> resolution that is an order of magnitude better than your CPU
> frequency and the accuracy of good atomic clocks. The 32-bit
> nanosecond counter has the nice property that inserted
> leap seconds in your time scale (say UTC) can be represented
> nicely as values 10**9..2*10**9-1.
> 
> Markus
> 
> --
> Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK
> email: mkuhn at acm.org,  home page: <http://www.cl.cam.ac.uk/~mgk25/>

-- 
Charles Hixson	charleshixson@earthling.net
(510) 464-7733	or chixso@mtc.dst.ca.us




  reply	other threads:[~1998-06-09  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-07  0:00 Calling C time function from ADA-95 Faust!
1998-06-06  0:00 ` Matthew Heaney
1998-06-08  0:00   ` Charles Hixson
1998-06-08  0:00     ` Dale Stanbrough
1998-06-08  0:00       ` Larry Kilgallen
1998-06-09  0:00       ` Markus Kuhn
1998-06-09  0:00         ` Charles Hixson
1998-06-09  0:00           ` Markus Kuhn
1998-06-09  0:00             ` Charles Hixson [this message]
1998-06-12  0:00               ` Larry Kilgallen
1998-06-07  0:00 ` Markus Kuhn
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox