Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128260 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 6283B1A00BC for ; Mon, 28 Jul 2025 13:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753709610; bh=BxiC1+HW/kY2kUI6jLFlk/po/T6OFCSQT7iXr5N9mLY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=C+mV3BXQVudqcnBsHThmFaCO51UJf2Nu1wQR1xKxXPDrITPIGrXrZWFE/UEsuGw1m jaO/hW4B3AHxgaNtIYjxVQ/hvLwxPzb08jhuGXGzgPv4dG2q0GQFfkgmWCRn/hHuWV dthdai6lTU/++5hqdc/wWfW3H2zaviZBLQd2u20+Js8pG3Nbj7xO9rSLfix/zhFFYm MEcO9PFyd9P5BaOfuImhYXhhmVK7hPOXzYCRokr1k9GMIeyLSWoTEQSyPqam4ceQaz iDrZ4MTZJbwoXRXImYFbIXNeVeixAugpg0oLw5n/JwcZLkaCquvxd2FtbMD1rMXKOW 2+R2ysu5YJWKQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 958FD1804F3 for ; Mon, 28 Jul 2025 13:33:29 +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=-0.7 required=5.0 tests=BAYES_05,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, 28 Jul 2025 13:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1753709710; bh=xILzbY0rbf/JBJqPrUgDOMeMIRsQIA4hZLGjbKV9wec=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=GQrCvsLUFm67aeAK565qMmzc18ysCY01+e8WjJg6/scL5JdTPnERR0HSSwN1n/BZY 5qOjwE92LL/JmoLnJTTOXO8xWYoEXHt/h6cc8oSlD0SauZvkgx/xSBUOYsiyGBRgb6 nS9VzRWz4eRHpQY/ALuPts8AE7hY0b8P0abGG+MeuorEoKuZSnlsJ0UAvIOfZgUOPS /S0EkzQxND8v4vfz6ysI0+DtmsEzfpfEANvwcbOJSi6xn1sqRYmwmdj7n9JZrLH+0H j5kwLFaptNxq/pyOu1CMywjbQbNW18Qpsqtz+0IxmjVc/TmwgqezNPv9GN5WQFCgAC q587bMElfCXvA== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 28 Jul 2025 15:35:10 +0200 To: Alexandre Daubois Cc: "Gina P. Banyard" , PHP internals list Subject: Re: [PHP-DEV] [DISCUSSION] Adding the "is_integer_safe()" function In-Reply-To: References: Message-ID: <678aea5ae01daf775246288a757a28a0@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-28 15:00, schrieb Alexandre Daubois: > is_representable_as_float(2**53); // false, precision loss when > casted to float Similarly to my other email: This is false. 2**53 is exactly representable as float. Every power of two (<= 1024) is. > is_representable_as_float("1e308"); // true This is false. 1e308 is not exactly representable. The nearest representable value is 1.00000000000000001098e+308: https://float.exposed/0x7fe1ccf385ebc8a0 Best regards Tim Düsterhus