Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121495 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16016 invoked from network); 28 Oct 2023 15:47:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Oct 2023 15:47:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1844B1804F5 for ; Sat, 28 Oct 2023 08:47:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 28 Oct 2023 08:47:32 -0700 (PDT) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 6EAED4012B; Sun, 29 Oct 2023 00:47:29 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1698508049; bh=Zrp7CE1UxwICWeTq2sP5PDwfRnZuAmy7m5V/Os9PsxI=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=EjcswX6nrZq0kCJaS8IAHLjOPHS/JyqkKAIEXkuOrQgOWfKyrwqj0js251JTGlD1G gay1ojrW6bOcnL5Q6UoQiHNaR+yHMjwvO/f9ip0rksUG/uopYArGxoTLveJ+iIQxsq gs6SsAcgPkmlnjGsZheRblSn/CVN5MWXjsvZrT0g= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Sun, 29 Oct 2023 00:47:17 +0900 Message-ID: <6A744D0D-8841-45BE-A72A-A1323AED52BE@sakiot.com> References: Cc: internals@lists.php.net In-Reply-To: To: Rowan Tommins X-Mailer: iPhone Mail (21A360) Subject: Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp From: saki@sakiot.com (Saki Takamachi) Hi Rowan, > I'm not sure where you got those numbers; on a 64-bit architecture (surely= the vast majority of PHP installs), a float can precisely represent any who= le number from -2**53 up to 2**53 - 1. As a Unix timestamp, that's a one-sec= ond accuracy for any time 285 million years into the past or future. https:/= /www.wolframalpha.com/input?i=3D2**53+as+unix+timestamp >=20 > Possibly you're thinking of a representation that counts integers as milli= seconds or microseconds, instead of seconds? Yes, I'm assuming a timestamp that includes up to microseconds. This is beca= use in the last example of the PR description, the microsecond timestamp was= expressed as a float. For information on the number of digits that guarantee float accuracy, pleas= e see the following documentation: https://www.php.net/manual/en/reserved.constants.php The constant PHP_FLOAT_DIG is its value. This is set to 16 for IBM and 15 fo= r others. Regards. Saki=