Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 + RN 4.3; site inset.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!cmcl2!seismo!mcvax!ukc!stc!inset!mikeb From: mikeb@inset.UUCP (Mike Banahan) Newsgroups: net.lang.c Subject: Re: ANSI 'C'. Message-ID: <805@inset.UUCP> Date: Tue, 26-Nov-85 05:46:05 EST Article-I.D.: inset.805 Posted: Tue Nov 26 05:46:05 1985 Date-Received: Fri, 29-Nov-85 00:27:13 EST References: <447@graffiti.UUCP> <538@brl-sem.ARPA> <170@watmath.UUCP> <171@watmath.UUCP> Reply-To: mikeb@inset.UUCP (Mike Banahan) Organization: The Instruction Set Ltd., London, UK. Lines: 22 Xpath: stc stc-a In article <171@watmath.UUCP> rbutterworth@watmath.UUCP (Ray Butterworth) writes: >The standard obviously didn't put much thought into anything related to >times. They define type "time_t" as an arithmetic type that represents >the time, and then define a difftime(time_t time1,time_t time2) that >computes the difference between these two arithmetic values. Why the >function? Does the standard have a new arithmetic type on which the >operation of subtraction is not allowed? >And then they define a function gmtime(const time_t *timer) that takes >a pointer to the arithmetic value, which it is not going to change anyway. >Why not just take the value itself instead of the pointer? Because they realised that some systems store time in microseconds, others in encoded formats with seconds in the bottom 6 bits, hours in the next 5, etc ad nauseam. The data type may be arithmetic, but its contents aren't guaranteed to be in any given format. Hence the procedural interfaces. Perhaps they put more thought into it than you did? -- Mike Banahan, Technical Director, The Instruction Set Ltd. mcvax!ukc!inset!mikeb