Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Tue, 15 Apr 2025 16:42:05 -0700 Organization: None to speak of Lines: 68 Message-ID: <87plhd0z76.fsf@nosuchdomain.example.com> References: <87y0wjaysg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 16 Apr 2025 01:42:10 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d66e934c2e3cca42eaa548516797f624"; logging-data="866624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aiiIOvO4ypv2z/zjgs20h" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:qL7G/hj0LaA4hiZgMCchslA35Ck= sha1:Fqb7pcOFeeAmpaT3HE8EY9GgnyM= Xref: csiph.com comp.lang.c:392581 >BGB writes: > On 4/15/2025 9:10 AM, Scott Lurndal wrote: >> BGB writes: >>> On 4/14/2025 5:33 PM, Lawrence D'Oliveiro wrote: >>>> On Mon, 14 Apr 2025 13:36:07 -0500, BGB wrote: >>>> >>>>> On 4/14/2025 12:40 PM, candycanearter07 wrote: >>>>> >>>>>> Lawrence D'Oliveiro wrote at 04:33 this Monday (GMT): >>>>>> >>>>>>> I worked out that an integer of a little over 200 bits is sufficient >>>>>>> to represent the age of the known Universe in units of the Planck >>>>>>> interval (5.39e-44 seconds). Therefore, rounding to something more >>>>>>> even, 256 bits should be more than enough to measure any physically >>>>>>> conceivable time down to that resolution. >>>>>> >>>>>> The problem then becomes storing that size. >>>>> >>>>> More practical is storing the time in microseconds. >>>> >>>> Relative to what epoch? >>>> >>> >>> Probably still Jan 1 1970... >> Technically, it depends on the timezone: Technically, it does not. POSIX defines the epoch as follows: Historically, the origin of UNIX system time was referred to as "00:00:00 GMT, January 1, 1970". Greenwich Mean Time is actually not a term acknowledged by the international standards community; therefore, this term, "Epoch", is used to abbreviate the reference to the actual standard, Coordinated Universal Time. The epoch is a specified moment in time. That moment can be expressed as midnight UTC Jan 1 1970, as 4PM PST Dec 31 1969, or (time_t)0. GMT/UTC is just a convenient way to specify it. >> $ date --date="@0" >> Wed Dec 31 16:00:00 PST 1969 Yes, the date command by default uses the local time zone by default. > Well, and however much error there is from decades worth of leap > seconds, etc... Yes, leap seconds are an issue (and would be for any of the proposed alternatives). > But, yeah, better if one had a notion of time that merely measured > absolute seconds since the epoch without any particular ties to the > Earth's rotation or orbit around the sun. Whether or not its "date" > matches exactly with the official Calendar date being secondary. That's called TAI; it ignores leap seconds. See clock_gettime() (defined by POSIX, not by ISO C). (Not all systems accurately record the number of leap seconds, currently 37.) Most systems don't use TAI for the system clock, because matching civil time is generally considered more important than counting leap seconds. [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */