🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2153

Re: Change to time() fn?

#2153
From: Karl Heuer
Date: Tue, 29 Sep 1992 15:42
17 lines
1324 bytes
In article <1992Sep26.153421.7698@cpio1.fr.mugnet.org> bernard@cpio1.fr.mugnet.org (Bernard Fouche) writes:
>[Making |time_t| a |double| could lose accuracy]

True, but if it can exactly represent all the values that a |long int| can,
then it's no worse than what we have now, right?

>[The solution is to use a Bignum library]

Unfortunately, in order to allow for implementations that have no clock, the
Standard requires that |time()| be able to return the constant |(time_t)-1|
to indicate failure.  Hence, |time_t| must be an arithmetic type.

Looks like the original implementation (when |time()| returned its value
*only* through its argument, because |long int| wasn't supported) was on the
right track after all.

Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint
Technical Details
Message-ID: <1992Sep29.154252.5453@ima.isc.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!know!cass.ma02.bull.com!think.com!spdcc!dirtydog.ima.isc.com!karl
References: <1992Sep15.042120.27559@nntpd.lkg.dec.com> <1992Sep17.120636.29070@linus.mitre.org> <1992Sep26.153421.7698@cpio1.fr.mugnet.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!cass.ma02.bull.com!think.com!spdcc!dirtydog.ima.isc.com!karl
From: karl@ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: Change to time() fn?
Message-ID: <1992Sep29.154252.5453@ima.isc.com>
Date: 29 Sep 92 15:42:52 GMT
References: <1992Sep15.042120.27559@nntpd.lkg.dec.com> <1992Sep17.120636.29070@linus.mitre.org> <1992Sep26.153421.7698@cpio1.fr.mugnet.org>
Sender: usenet@ima.isc.com (news)
Organization: Formerly of Interactive Systems, Cambridge, MA
Lines: 17