ANSI 'C'.

Ron Natalie <ron> ron at brl-sem.ARPA
Sat Nov 23 14:48:10 AEST 1985


> 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?

Because this isn't ADA.  Well if the specification says arithmatic
type, I'll take exception with it.  Time_t on many systems is a
struct.  Even so, consider a machine that stores the time packed in a
an int or other arithmatic type that is not just some count of ticks
since some base time.  We had one system that encoded it's time in
BCD (stupid military system required it), obviously you just can't
subtract two BCD numbers that are stored in an int and expect it to
do something meaningful.

-Ron



More information about the Comp.lang.c mailing list