Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123024 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 60C5B1A009C for ; Sun, 7 Apr 2024 19:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712519801; bh=9AaBgYcpqD6WBTUXf/i2gqKkuW2YBI6ZcPGql+9NSsk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VOnxvOyVchu1QWxAqr/RUkMp5WB/H1MCuePY1ZWEE+gDRXiz4e4qAhmG3wqYnweLS rHexm+QYTCN+ciegI1v5Tr3k6evZPF42BvidCOm9Af0mvj+FetPSIm7tttq+RAcs6A CUQMRiVBhC4Zo8OxQWFVzCxdECwffr7Yzct/4KQki4YJw5TTVjgubHO7KAOr7Gx6ho EbxsXvKFRPTDEXCrs1B9qpW+xufd45wbt0ItURYscT3tftwfJiYc8QXd4jJiq8Olv7 HKnfwuKz5NUBJ+upN8qlcFYBKu8C+q3GphAVwzdYVe//9DyNoc1NJztgbNlYS05k14 hQ5eOpLboNekg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0F55D1806A2 for ; Sun, 7 Apr 2024 19:56:40 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 ; Sun, 7 Apr 2024 19:56:39 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-29b7164eef6so3076412a91.2 for ; Sun, 07 Apr 2024 12:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712519767; x=1713124567; 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=GAVy0A55HF9bD6UMjRdmrYRwSV+dD9QOuPOdmtxKhCY=; b=gOf1jdReFl2Zb+6Cvu2GdkbEvbwLUZj48phnlDdiSAB2uKpDXtZNb2RuDr2b12wjr8 wRnSZzUDfKRcCnRtGxvC1rIzPbMFyCftl35YbOvo3iin+E5WM+cOfwQoTYS4q7NGUO+D xdw1UVJDcWx7aGdwXYgJ73ne4vQNx3xd7V+PiQ7n/totsHv9uanMsZGvmuUUnf9wUGcE 61/QzTgj3bsAxSmyI71uoCb+TqH6dAIfDklYY4LQnwrlsTGXLTmsZ3nfLsAe3c37JqWv KP3gYRpdebIil+ApuXjcYlid3PpgsyG/DofXF2U7CA0Ph4pSsZjisf1WPiJ6PYQYtNIP 66Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712519767; x=1713124567; 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=GAVy0A55HF9bD6UMjRdmrYRwSV+dD9QOuPOdmtxKhCY=; b=OR0ZKnRwTE9dKKDOTljvSL6Nb6AUQqqkZDbEyDhW7aSZUfikbhQoe66605ReM2vhlA 8hnN75DRUeTde2a2uTEqdyzNeHFRLrw/rxJ8xZ3XvmP4BgMeQX8GfAMuxCQBjQndlffX D9gJDmWhWU0rqFm09kk5nJDNqd5hf5S+54AqQbAeVvIQgk+NC5DGKV1MuHISfQ67N5cg kr2GyRlPAJUoXNeW9+dSetFdg7qG8ct8P7rhh59qg0xQJsJyPprnjnCpebgWwkQ1WNiO yfXvrd5nK8Y4mq/i4oA9AqUqHeRkLu/GVvbVy/XCvwSKpKM/TcXcl/hcENBlmonRRZHw LSCA== X-Gm-Message-State: AOJu0YzQqdOZyxvMoMZ9nkWypD/0pxuqyvlMHscJZhgUJknIaP1xlhAH oyJDbe/wLpLUmujaAdtITmX7tFN2EMuMfLj5Sl0nTGetfXClepoVC4Z42H1THtxmSyO7h/70igK 7OGY1/aPhQbv66MTuvtDM8moSWCndvJ9/r2I= X-Google-Smtp-Source: AGHT+IFfnJJdss6Qk2AhPX3PedJ2HH2Ea0u8NlEtO7i/cKHiYEi1wfQKhg+RPZJB7gzsqp3aZiZSMabX84pCfWF/pZ8= X-Received: by 2002:a17:90a:1281:b0:2a2:bd4b:764f with SMTP id g1-20020a17090a128100b002a2bd4b764fmr5864850pja.3.1712519767179; Sun, 07 Apr 2024 12:56:07 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <40553F28-2EC2-475A-BD8E-1D6517AA2A51@rwec.co.uk> <2B518F62-B774-45C9-82A2-EF6653AAE34E@sakiot.com> In-Reply-To: Date: Sun, 7 Apr 2024 12:55:53 -0700 Message-ID: Subject: Re: [PHP-DEV] Native decimal scalar support and object types in BcMath - do we want both? To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000064c97f06158714cc" From: jordan.ledoux@gmail.com (Jordan LeDoux) --00000000000064c97f06158714cc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 7, 2024 at 8:27=E2=80=AFAM Rowan Tommins [IMSoP] wrote: > > > On 7 April 2024 15:38:04 BST, Saki Takamachi wrote: > >> In other words, looking at how the efforts overlap doesn't have to mea= n > abandoning one of them, it can mean finding how one can benefit the other= . > > > >I agree that the essence of the debate is as you say. > >However, an argument must always reach a conclusion based on its purpose= , > and combining two arguments with different purposes can make it unclear h= ow > to reach a conclusion. > > Well, that's the original question: are they actually different purposes, > from the point of view of a user? > > I just gave a concrete suggestion, which didn't involve "combining two > arguments", it involved splitting them up into three projects which all > complement each other. > > It feels like both you and Jordan feel the need to defend the work you've > put in so far, which is a shame; as a neutral party, I want to benefit fr= om > *both* of your efforts. It really doesn't matter to me how many mailing > list threads that requires, as long as there aren't two teams making > conflicting designs for the same feature. > > Regards, > Rowan Tommins > [IMSoP] > Eh, my first reply wasn't really about defending anything. It was to inform. I have been doing small bits of work, research, and investigation into an MPDec or MPFR implementation for years, and I'm likely to continue doing my research on that regardless of whatever is discussed in this thread. Rowan, my point wasn't so much that a discussion like this one is pointless, it was that MOST of the people who actually vote on RFCs don't reply at all to internals, so a discussion like this actually does not help anyone understand the opinion of MOST of the people that actually need to be convinced. We hope the discussion is representative of the people who do not engage with it, but we don't know for sure. In any case, an alternative implementation using MPDec/MPFR probably can't be done until 9.0 at the earliest, but Saki's improvements to BCMath are ready to merge now, essentially. > Is there anything in the proposal which would actually be different if it was based on a different library Yes. BCMath uses fixed-scale, all the other libraries use fixed-precision. That is, the other libraries use a fixed number of significant digits, while BCMath uses a fixed number of digits after the decimal point. So, for instance, it would not actually be possible without manual rounding in the PHP implementation to force exactly 2 decimal digits of accuracy in the result and no more with MPDec. The idea of money, for instance, wanting exactly two digits would require the implementation to round, because something like 0.00000013 has two digits of *precision*, which is what MPDec uses, but it has 8 digits of scale which is what BCMath uses. Jordan --00000000000064c97f06158714cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Apr 7, 2024 at 8:27=E2=80=AFA= M Rowan Tommins [IMSoP] <imsop.p= hp@rwec.co.uk> wrote:


On 7 April 2024 15:38:04 BST, Saki Takamachi <saki@sakiot.com> wrote:
>> In other words, looking at how the efforts overlap doesn't hav= e to mean abandoning one of them, it can mean finding how one can benefit t= he other.
>
>I agree that the essence of the debate is as you say.
>However, an argument must always reach a conclusion based on its purpos= e, and combining two arguments with different purposes can make it unclear = how to reach a conclusion.

Well, that's the original question: are they actually different purpose= s, from the point of view of a user?

I just gave a concrete suggestion, which didn't involve "combining= two arguments", it involved splitting them up into three projects whi= ch all complement each other.

It feels like both you and Jordan feel the need to defend the work you'= ve put in so far, which is a shame; as a neutral party, I want to benefit f= rom *both* of your efforts. It really doesn't matter to me how many mai= ling list threads that requires, as long as there aren't two teams maki= ng conflicting designs for the same feature.

Regards,
Rowan Tommins
[IMSoP]

Eh, my first reply wasn't r= eally about defending anything. It was to inform. I have been doing small b= its of work, research, and investigation into an MPDec or MPFR implementati= on for years, and I'm likely to continue doing my research on that rega= rdless of whatever is discussed in this thread.

Ro= wan, my point wasn't so much that a discussion like this one is pointle= ss, it was that MOST of the people who actually vote on RFCs don't repl= y at all to internals, so a discussion like this actually does not help any= one understand the opinion of MOST of the people that actually need to be c= onvinced. We hope the discussion is representative of the people who do not= engage with it, but we don't know for sure.

I= n any case, an alternative implementation using MPDec/MPFR probably can'= ;t be done until 9.0 at the earliest, but Saki's improvements to BCMath= are ready to merge now, essentially.

>=C2=A0 Is there anything in the proposal which would actually be different if it w= as based on a different library=C2=A0

Yes. BCMath = uses fixed-scale, all the other libraries use fixed-precision. That is, the= other libraries use a fixed number of significant digits, while BCMath use= s a fixed number of digits after the decimal point. So, for instance, it wo= uld not actually be possible without manual rounding in the PHP implementat= ion to force exactly 2 decimal digits of accuracy in the result and no more= with MPDec. The idea of money, for instance, wanting exactly two digits wo= uld require the implementation to round, because something like 0.00000013 = has two digits of *precision*, which is what MPDec uses, but it has 8 digit= s of scale which is what BCMath uses.

Jordan
<= /div>
--00000000000064c97f06158714cc--