From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100159,805e0071ac25e02c X-Google-Attributes: gid100159,public X-Google-Thread: f6653,805e0071ac25e02c X-Google-Attributes: gidf6653,public X-Google-Thread: fc89c,805e0071ac25e02c X-Google-Attributes: gidfc89c,public X-Google-Thread: fcda7,805e0071ac25e02c X-Google-Attributes: gidfcda7,public X-Google-Thread: 11035d,805e0071ac25e02c X-Google-Attributes: gid11035d,public X-Google-Thread: 115614,805e0071ac25e02c X-Google-Attributes: gid115614,public X-Google-Thread: 10650a,805e0071ac25e02c X-Google-Attributes: gid10650a,public X-Google-Thread: fee84,805e0071ac25e02c X-Google-Attributes: gidfee84,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: best UNIX OS as primary platform for UNIX system software develpoment? Date: 1996/09/15 Message-ID: <842824504snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 180788585 x-nntp-posting-user: fred@genesis.demon.co.uk references: <322E9A9E.264F@uebemc.siemens.de> <322F54A6.44FE@cao.mts.dec.com> <842570087snz@genesis.demon.co.uk> x-mail2news-path: genesis.demon.co.uk organization: none reply-to: fred@genesis.demon.co.uk newsgroups: comp.unix.solaris,comp.sys.sun.misc,comp.sys.hp.hpux,comp.unix.internals,comp.unix.programmer,comp.unix.aix,comp.unix.osf.osf1,comp.sys.sgi.misc In article Dan.Pop@cern.ch "Dan Pop" writes: >In <842570087snz@genesis.demon.co.uk> fred@genesis.demon.co.uk (Lawrence Kirby) > writes: > >>In article >> richard@cogsci.ed.ac.uk "Richard Tobin" writes: >> >>>In article Dan.Pop@cern.ch (Dan Pop) writes: >>> >>>>Within the frame of ANSI C, printing a time_t value is pointless, >>>>because the way the time is encoded is unspecified. >>> >>>You might want to read it in again later. >> >>In that case just print it as: >> >> printf("%Lf", (long double)t); > >But you may lose bits of precision if the bits of the time_t value don't >fit in the mantissa of a long double. OTOH double may well be considered enough since that is the limit of the precision of difftime(). OK, there's no perfect solution however double/long double will work on any reasonable implementation and even where it isn't exact it is only likely to be inexact to a vary small fraction of a second. There's a problem even when time_t is known to be integral since there's no guarantee that you can uniquely map all the values of long to unsigned long (or vice versa). So for the ultimate belts-and-braces solution one you'd determined it was integral you'd also need to test whether time_t is a signed or unsigned integral type. I'm still happy with long double. -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------