🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2185

Re: Change to time() fn?

#2185
From: Graham Stoney
Date: Fri, 02 Oct 1992 02:34
20 lines
1518 bytes
alpha@waggen.twuug.com (Joe Wright) writes:
>Please remember that floats (and doubles) are approximates.
>The value of time_t must be precise.  We don't like a value
>which says 'it's almost 5 o'clock'.  Precision requires
>time_t to be an integer.

But time is a continuum; it is not discrete. Integers, floats and doubles all
store discrete values, so none of them can precisely represent all values of
time, not even in a small fixed interval. You may not like a value that says
"it's about 5 oclock", but that's the best we can do. A floating point time_t
will allow finer resolution for times near the epoch than an integral one, and
less resolution for times far from the epoch. An integral time_t abruptly
becomes unable to represent the time at all as you move away from the epoch,
whereas the precision of the floating point time_t degrades gracefully. Since
we are normally more interested in times near the present than the distant past
or future, this is a reasonable tradeoff. I think this was the original
poster's point.

regards,
Graham
Technical Details
Message-ID: <BvH368.KA9@research.canon.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!mama!greyham
References: <1992Sep29.154252.5453@ima.isc.com> <1992Sep30.034813.2589@waggen.twuug.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!mama!greyham
From: greyham@research.canon.oz.au (Graham Stoney)
Subject: Re: Change to time() fn?
Message-ID: <BvH368.KA9@research.canon.oz.au>
Sender: news@research.canon.oz.au
Organization: Canon Information Systems Research Australia
References: <1992Sep29.154252.5453@ima.isc.com> <1992Sep30.034813.2589@waggen.twuug.com>
Date: Fri, 2 Oct 1992 02:34:55 GMT
Lines: 20