Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123921 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 A7AD71A009C for ; Thu, 27 Jun 2024 04:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719462182; bh=a1w2aBB4kSSautPKEdKi3Nbhj4xmD6zTKK4SULq8B5Y=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=G+dXkL+zcJtWha3cGZEBV3LMS06UZPAxOXXeWMBDUnsf2KU/R4sDT9X/0tgAVXtzY wq+8+F3TOGAYCU+tgmXmhiRybJoWgFRtz9jx13FCgL7DDhF9FUgUXNOIpn9j7rBVL7 W2TfhKyp73Mb/qJwMqI+QVHXaYusEGM2zAKDtC2FL3WhuH8x2EA3v/GBZ7ioxnmGOL XxnJQT7TcV7T4jl9R/XO6313BJ5s2Rc01QvJ/VEZNdf4tw4wmVXbkknDlljDRtpcwx IaLSDdF+Mi/hYm3+R+rMM8NgWGu+X/aWQIUWM2x2SRY5L3p6+DEVL3cIQYb4wud9GD Y2GasjwabK3wQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 19FA8180EA1 for ; Thu, 27 Jun 2024 04:23:00 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 27 Jun 2024 04:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1719462097; x=1719721297; bh=a1w2aBB4kSSautPKEdKi3Nbhj4xmD6zTKK4SULq8B5Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=QnF77imJVAW74stHySyThjfqJvXtxrABFXWA+W0PkTLp8ZW2psk3CNz2zUg6OYZSV VsS0+C+GcsOV3HA18VepnS1wl3fBprOWSNFTUMejX3GU8c6PXJYDm5XbDabpsmqDbd OznyjWsY1xfIYDZ+8PzhKSLoRQVJum5w2HDoihdweGZzJX+GS+AtBsjcm/pxD7oRog nPrX+b1otuvsb/zUQbcJw/j7OTLVVmcMM1vhVY2Fvqt4jDcz+aKwAGzw2ojgkoXUSm FZR94YbUExvWaebDnw9BWGhfen3vUHGHiFGU3WQgX6ulrWb91FC4qqOV+RREFkjOZQ lGWdOunmz1omA== Date: Thu, 27 Jun 2024 04:21:35 +0000 To: Saki Takamachi Cc: php internals , =?utf-8?Q?Tim_D=C3=BCsterhus?= Subject: Re: [PHP-DEV] [Discussion] Follow-up RFC for BCMath\Number object Message-ID: In-Reply-To: References: <1D8D71FE-20DC-40E4-BEA5-4B438B8BC825@sakiot.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 8c0176da95d1a13a1dd42df5172877f45947b73b Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 25 June 2024 at 17:58, Saki Takamachi wrote: > Hi! >=20 > This is a reminder as the feature freeze is approaching. I would like to = restate my current opinion. Apologies for the delay, to much traffic on the list so I forgot to address= this. >=20 > > - Suggestions for using 64-bit integer types internally for performance >=20 >=20 > This is probably unnecessary. It's already fast enough, so it might be a = good idea to consider it when we need even more speed. Also, if we want to = speed things up even more, it would probably be better to change the design= of the bc_num structure. ACK, this seems to be fine. >=20 > > - Points out regarding naming, such as changing "powmod" to =E2=80= =9CpowMod=E2=80=9D >=20 >=20 > A function called "divmod" is also commonly used in other languages. If f= ollow that naming, "powmod" is not unnatural. Since "bcpowmod" already exis= ts, I feel that it is okay to leave it as "powmod=E2=80=9D. >=20 > > - Points out regarding comparison methods >=20 >=20 > For now, all comparisons are possible with just "compare", so I'll use on= ly one comparison method. This requires an override RFC. I'm grouping those points together. My main concern with adding those methods to the class is that this will po= tentially conflict with any implementation of operator and/or comparison ov= erloading. This is why I would rather not have the methods at all, if the idea is to h= ave a "procedural" API I feel revisiting Andrea's old "Operator functions" = RFC would be better. https://wiki.php.net/rfc/operator_functions >=20 > > - Whether existing BCMath functions should accept BCMath\Number >=20 >=20 > At least not in 8.4. I don't think any ideas for how to use scale properl= y will be finalized before the feature freezes. ACK, the context is also different than for ext/gmp which I misremembered. >=20 > > - About the behavior when casting BCMath\Number to bool >=20 >=20 > If the value is 0, it is treated as false, otherwise it is treated as tru= e. This alone may not require an RFC, but I'm planning to create an RFC for= the comparison method, so I'll include it there. I think this is the most sensible, in which case I think GMP should also fo= llow suit and have the same semantics instead of currently being broken whe= n you try to cast to bool. >=20 > > - Regarding whether the method you plan to publish is really necessary >=20 > I decide to delete the format method. We can cast or get the value from t= he property. In some cases, we may consider adding it again, but at least n= ot in 8.4. This also requires an RFC. >=20 Seems sensible to me. Best regards, Gina P. Banyard