Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121628 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73033 invoked from network); 9 Nov 2023 20:53:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Nov 2023 20:53:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 842701804D4 for ; Thu, 9 Nov 2023 12:53:56 -0800 (PST) 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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 ; Thu, 9 Nov 2023 12:53:55 -0800 (PST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6c10f098a27so1206326b3a.2 for ; Thu, 09 Nov 2023 12:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699563234; x=1700168034; 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=AFPGqy0qE97PUBn8JzLVuD1UO1BKd/EQkI8eotRAKEg=; b=l+fPTdcwDl3d+IRnJbVMGon/n6S1syvwgcFPw33gnkh5BKR4f3dIephe0M1QD4VlvM pTgD3/0udqBLvNViB/lNUuff3neNyBCyh2XP6ke2MNQWa+f+eDWJ+R5+iVfs/MKHCdcD Of2MtHNmSbofHTQD9N3foh7XuMiaFV7i6MCqFV7zsu7fqNKNOyhMq8A7YJhh41Bb2VsH qCoPOGqcvx0dgNsJ4IYgdGubFgCNgMT82YE4WcIVPi4in3LSOfYXeeEuDv3LZjOwBLOG JI13jYuC3s0+xFeW8jo69eImxDkOlItyIHe31n0Rp/Pk9V6y8iY+4YNLr+7pfxXx9AmJ pGPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699563234; x=1700168034; 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=AFPGqy0qE97PUBn8JzLVuD1UO1BKd/EQkI8eotRAKEg=; b=Rm77L1R/whrwnonOc01ZYexUsnNXQG8MwLPIsU7zo4jzcede9xP1nfizQfdQQzUphH payOyGma58NkMbOD/5C9NKtCkjvAyE81REAg66m+z/j3uG1NC/lmUL3ffwsaAxSK1mOK p6IDFsqedmXG3tORnYZ1QAm6WHVn9nWXTb2PahFtkz/7Sf8PmXsmTUvEc8o/OMGvRjHo UsVD0o4jUsah+qH5Q0KAWX7MpxxDU/FUs5sgJHAw6G/hpg3MBaWPmcqWt3ptN8IdRYD1 /2D7FIIas0kaiBMJIhsLHvbkI1ddsfApfbSPC2RmDT4fag5VH/xzqA0R+yQ7R5uYphjm cfYA== X-Gm-Message-State: AOJu0YxaDUWhlY5miIfNjy4EOevSqG/MrE0IRhKeZ/XGJWFcFO5kvH9g hiajoUETEJ5q6mu5pvT5EkbAUb9vrcUhTztUBH9CGg0q4fkjlA== X-Google-Smtp-Source: AGHT+IFWlLRyzawTOVaOhbVJk1u5764+VVnynREVuzYA7N/mfP2y4tHY8v8IV5Wnx56gu3rSReavj3vA3JQQpSFijPQ= X-Received: by 2002:a05:6a20:7353:b0:153:a461:d96e with SMTP id v19-20020a056a20735300b00153a461d96emr6461906pzc.47.1699563234251; Thu, 09 Nov 2023 12:53:54 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 9 Nov 2023 12:53:41 -0800 Message-ID: To: Saki Takamachi Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d9d8a70609be66f5" Subject: Re: [PHP-DEV] [RFC] [Discussion] Change the edge case of round() From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000d9d8a70609be66f5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Oct 23, 2023 at 4:14=E2=80=AFAM Saki Takamachi wr= ote: > Hi, internals > > I would like to start the discussion for my RFC "Change the edge case of > round()=E2=80=9D. > https://wiki.php.net/rfc/change_the_edge_case_of_round < > https://wiki.php.net/rfc/adding_bcround_bcfloor_bcceil_to_bcmath> > > Regards. > > Saki > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > I think this makes much more sense if PHP programmers had internal access to the float type in PHP, but that's not the case. You cannot choose between float representations, you cannot easily examine the mantissa bits directly. In the absence of stuff like that, I think the argument to treat PHP floats as if they were decimals for the purposes of rounding is much stronger. That said, this sort of 'intelligent' rounding certainly introduces a large number of edge cases. Additionally, if PHP programmers expect decimal rounding to "just work", then it feels like anywhere that it doesn't work the way they think it should is a bug, which isn't necessarily true. I'm unsure whether or not this change actually improves anything. Is it more correct from a technical perspective? Absolutely. Does it provide a benefit for PHP programmers? That I am much less certain about. Jordan --000000000000d9d8a70609be66f5--