Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127023 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 qa.php.net (Postfix) with ESMTPS id 628BC1A00BC for ; Wed, 2 Apr 2025 06:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743574148; bh=WZR1gi60z5/bTDyNl/6H/Mi0kkcqDHx5+x9JM/RAEv0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iOIWUP9ozFG6VNAtYXC/cKIpTnGAOLjoe+WZOLqkmaJ7rH8GJYc9IVJGdDU1WYXUP q2onLcwA5YpUmkBXXwEF+K5TdcrPjnZqB5KRjdDZzbW0pgOyGciP168QwquZAFrp9l uzucTXrXXmgrj+yqcVrwvDKfi8F0/xK2a3OjQjkbm6Dse8aKqYq0F+wf8H8F+vHN5l FXbmLboYBCt17f8bC3GVFMjov1l/qj3QxNNil8ccd5eY0/aOXn8iEYwK2WqwQqg4uT pr54DVqVCniJ3HmW1XO9QYiDmu2syBat6fXd2EubvDebDqUvsTk40WD9bMSDDnIQdU 1rkAD6fjrHuFQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BEA5E180037 for ; Wed, 2 Apr 2025 06:09:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 ; Wed, 2 Apr 2025 06:09:04 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5e6ff035e9aso7359666a12.0 for ; Tue, 01 Apr 2025 23:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743574290; x=1744179090; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7nM5FmbpDm+/5PSESyRZppuUT7e4eCcB2pO7nWxggiU=; b=SBKGdwLWDpEAxoifJZ79zkcWITqodsgFbJxs/v0mWEScBHu9Z+3JdHanvjVMTa0OYG y3VafmHxG5RtvmGImUyrFjH8Nr/EJrejQCQnpsid9gnepIrgZ9qxKu1B3RgBsGivJrZ8 bAfZ4bfWTPYlj1QJsuLWmuuAM1n/+39EzQ0k2AM8OeWEZ3PtVde2gvp4thK9vMdw4RhZ IAS46WvMo/iZOa4Fz/CGJD8a9xtlCaIgo/dlkFniIq7ZU57ipoivf3xhf0dePWrkMK7t t77TMPrgAyonLrg1llcqUbtIiPMWs592B2Mh+N68XGK63JSQGZcYtzQtaXgNriLFjbIq 8sJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743574290; x=1744179090; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7nM5FmbpDm+/5PSESyRZppuUT7e4eCcB2pO7nWxggiU=; b=HRn/bcL3SHY+TAaTRwxXcQTRygW9CH/lrcKdK8NU6D3AivShz57PYBXD63iDoJCh9Y GHCOpA8+D6mkzBp8pEtyqh4Gu5qrXJhKrUnhDZIdIFs2gKCGX/rWsW0CwYqp8CDERHLg 7Tm4H6NxUiwFZPGStoLpz7k9MIcWuzhdbmxtBanbAsq6KC6Ota9oCm3aso2yVEbVXfZG 2W/HMzczAdxGkZPKNZlOCZwkYp/nbHHh9EcBcYpQXmMj1iKmR+BS/X2gjG7r8mtxyKgk 13GKnO7ii2lGXzkThmGx40cQqLCLHXGAsCCBM5w6jGd2/ETE/2EHCf5uy4EdzZ+Oz3fZ U/aQ== X-Gm-Message-State: AOJu0YyyqIyW9I4GZS9M+TrO6w1V53mAZ9KdOU5S6RNA7IjPR+174F72 jl4XMZNxmI1yp5KaB2EwOFbiokc30t1uQt+jCcb3gnkgwWSpmxTrwJm8Q2VZLC1/7bpGdtY5xYW L+LxQLCDQhXRyBKdXtTNN5Pe5W4U= X-Gm-Gg: ASbGncsTEmI/CeJA9dkm5cKz+7rBThj9WcaiDfcUVfKAFJsrxwG3u/wqnt6ppZ3TfDv l3/UzNf6l5qO3vGAkK6ZgomDx7vKl0nMQBTy9ut83yTG0ZPlhY2/o1YTn3aLBaKJedwIjHTDq4d uvM7KGd6z5oFsCB2UpIWikWn5MHpkHFAmQjoE= X-Google-Smtp-Source: AGHT+IEL1nKM7MrYy7OPyZd/oQfggukzlr6hfRmeAqBKU89GkmF5QtQvZRPlucwvVO3BddSO5V5UhrwjtJqm/SimVE8= X-Received: by 2002:a05:6402:35c6:b0:5e6:13bf:2c7c with SMTP id 4fb4d7f45d1cf-5f02b1aeef3mr4349865a12.9.1743574289594; Tue, 01 Apr 2025 23:11:29 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> <799bd54a-2136-4410-823a-9233ccbeb16a@app.fastmail.com> <89495A22-BCBD-4779-835D-56B90257FF51@php.net> <371df6b7-2c4b-4bb6-b711-162e512ce145@app.fastmail.com> In-Reply-To: Date: Wed, 2 Apr 2025 16:11:17 +1000 X-Gm-Features: AQ5f1JrXu2zNXfY8Z_30qMKN4Opm_3LMI9jEQojg8Jsk9szukhUUCgcKVqRaoz0 Message-ID: Subject: Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator To: Iliya Miroslavov Iliev Cc: internals Content-Type: multipart/alternative; boundary="0000000000002bc2ea0631c58616" From: mickmackusa@gmail.com (mickmackusa) --0000000000002bc2ea0631c58616 Content-Type: text/plain; charset="UTF-8" I love April Fools jokes. Yes, and let's add the null coalescing increment and decrement operators: $foo??++ and $bar??-- . I want to ensure that an undeclared or null variable defaults to 0 before becoming 1 or -1 without needing to manually instantiate the variable as 0. Pfft. --- Anyhow, why wouldn't rounding precision be decided by the precision of the float/integer with the lesser precision? 1. 1.55 ~= 1.5499 // true (because rounding 1.5499 to 2 decimal places is 1.55) 2. 3.1415 ~= 3.141 // false (because rounding 3.1415 to three decimal places is 3.142) 3. 1000 ~= 999.50000001 // true (rounding to integer comparison) mickmackusa --0000000000002bc2ea0631c58616 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I love April Fools jokes.

Yes, and let's add the null coale= scing increment and decrement operators:=C2=A0 $foo??++ and $bar??-- .=C2= =A0 I want to ensure that an undeclared or null variable defaults to 0 befo= re becoming 1=C2=A0 or -1 without needing to manually instantiate the varia= ble as 0.

Pfft.
---

Anyho= w, why wouldn't rounding precision be decided by the precision of the f= loat/integer with the lesser precision?

1.=C2=A0 1.55 ~=3D 1.5499 // true (because rounding 1.5499 = to 2 decimal places is 1.55)

2.=C2=A0 3.1415 ~=3D 3.141 // false (because rounding 3.1415 to three = decimal places is 3.142)

3. 1000 ~=3D 999.50000001 // true (rounding to integer comparison)

mickmackusa
--0000000000002bc2ea0631c58616--