Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site alliant.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!linus!alliant!tj From: tj@alliant.UUCP (Tom Jaskiewicz) Newsgroups: net.lang.c Subject: Re: Re: ANSI C. Message-ID: <156@alliant.UUCP> Date: Wed, 22-Jan-86 18:38:26 EST Article-I.D.: alliant.156 Posted: Wed Jan 22 18:38:26 1986 Date-Received: Sat, 25-Jan-86 03:47:42 EST References: <3502@brl-tgr.ARPA> <618@baylor.UUCP> Reply-To: tj@alliant.UUCP (Tom Jaskiewicz) Organization: Alliant Computer Systems, Acton, MA Lines: 27 Summary: In article <618@baylor.UUCP> peter@baylor.UUCP (Peter da Silva) writes: >> difftime() accepts time_t arguments but returns a double. > >What's wrong with returning a long? 1. time_t may give millisecond resolution (or microseconds (or nanoseconds)) which you really want to have. 2. difftime may need to return a value larger than 2**32 (not likely but possible). In short, you want the range that floating point provides for you. >What's wrong with having a function: > >long seconds(time) >time_t time; Nothing really. But I would rather use difftime *unless* I had a good reason not to, such as running on a machine where >doing any floating point arithmetic in a program adds >quite a bit of overhead. -- #################################################################### # uucp: decvax!linus!alliant!tj ## Bernese are mountains of love. # ####################################################################