Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128034 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id B101F1A00BC for ; Mon, 14 Jul 2025 12:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752497785; bh=c1b5Lgl3OHE5+mKAAp6VWsdazrFQcd/sV6VqWb0cTyM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iDyQpz5aQPAbyI03dtN7ywIZuJZcFGtqjHwAuFrcZrFtuYwd/mT3GXHmtOeKGUBR1 6v7ycMry+Hqjt/0+iWA7hSM5ewzAzbrlAGdm/mLoC+V2CkYWrjq3V6uHKeWJ3QbgO3 Ci7+XrAUM8524zl+fZfpHDzGde13nUiau/oHZHpE35aBCj1T4j2NTZNLAQMnpVMXQ6 c15dY57ssTTyYI27PRkJQW1VtyxycAt1x2iYwjSk78Ho1239deJh4qrn99gY1X6fWV r5mCdXWVqYbFtY2bvNS4Tp/vzK4H/VfNKZx3uni6+B2iWtaYJpgdXN7iAuT+F2QOWD 6Dfn/nMMTIRRQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C7EB180079 for ; Mon, 14 Jul 2025 12:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 14 Jul 2025 12:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1752497890; bh=Sp0A9aYd7CdsZg+BA9m9IlhA4j3XurnJSKjD3OXgMB0=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=bcKY56ExRZo1bar2z+NQJnB8WNTHuI7R7wyrpzdD+sIn4U95dYv1tJ/7t5F3x68fe zOw/Ou2Ph06D92o2WPZ9Vb7t6OiZq/mcejfWNoBEZQKipbW3mOggec/NyiO0B7Igq6 q7teBr+6cAjZcXvxHiF6iISZbCSHQWA0yJsKFeGuMa8M4t0BwbmJGmuRhEjmL0W7d2 pYgFie/bvJsHFAmswA6YtdtlR/IUIKWh/4iq7w0VJgaQ4AigxzE0a12xcXTuSebua0 haBdwnQEwlfQZGUl5Nc1igwTp4yP+IiZQu+dODnIamHtFEivyxvr95l9yGCBXW+wQo jwN2WjREcVDYA== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 14 Jul 2025 14:58:09 +0200 To: "Gina P. Banyard" Cc: PHP internals Subject: Re: [PHP-DEV] Introduce PHP_INT_MAX_SAFE constant similar to JS's Number.MAX_SAFE_INTEGER constant In-Reply-To: References: Message-ID: <29824af0e40ad3e6281a1b7e249a4098@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-07-14 13:54, schrieb Gina P. Banyard: > The purpose of this integer is to indicate what is the maximal integer > value that can be correctly represented by a float. > On 32 bits this is equal to PHP_INT_MAX, but on 64 bits it is > 9007199254740991 (which is 2^(53) – 1) as the mantissa of a floating > point number is 52 bits. I don't understand why this should be equal to PHP_INT_MAX for 32 Bit builds. The largest integer that can be safely represented by a float is 2^53-1 for both 32 and 64 Bit builds of PHP. More generally, I do not understand the value of the constant. PHP has proper integers, whereas JavaScript does not. Best regards Tim Düsterhu