Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123222 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 1A6811A009C for ; Sun, 28 Apr 2024 06:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714285774; bh=bhTpgu2EcW8FOgLUoxe1yrL61m/hQexsGPRA1GFrCmU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Kh+oRVNYgMMciJoRBX4ytVxql65YM7OMfozeGWFnUPNQe8QF5CGWNT7HIyavziNY/ Ni4P6tkQ/qlr+DPw8N9K6wyBBNXhbop7eexkHoL/8cJN7DAtfy9n59P8Se8y6+gaC5 zVATtVytiqrJocAjuDTW0F9XXJduG0plO/x+NXLM5CIluGiCIhBKoIm4L+i9DBZhbi o5kUT8i+D6w7NXEnFMOJS5Flvkq3n9aSR7cjDdPIRz0WgcbEHq3inEnvvhb/bbq/Mh J1T/Hl27INlScI1p4WX4Z+riNtSWa41t496p9a5xECAKBY6gDf1xJtsEUo1es1A/an JIVN6JDmz41BQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C3A118005B for ; Sun, 28 Apr 2024 06:29:31 +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-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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, 28 Apr 2024 06:29:30 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2a52c544077so2602439a91.1 for ; Sat, 27 Apr 2024 23:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714285727; x=1714890527; 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=bhTpgu2EcW8FOgLUoxe1yrL61m/hQexsGPRA1GFrCmU=; b=hCw0MBAADGbQI4ZhZ2o6JLiNllghNd7C9vzRuS8cSOSu4RsOnAt5kZnYYu3ceIS+Mv 7aAuFwdzqw+2GG0ccNFANxDUdqaGCBEfzXT6oUxa3umiNHVEPWqYe6gJiPIphJYdv/uP ReayczYxDn4GeDO9ANYuNFFWPD+B1Rr2Ivu72Z6nKCg4H28n1eKS9XpF9EJSWRG+Ufa0 HtQwYEM7H3qezjUb1tdXByX76IAUMDBA8c8p3BsoFitYJDf1pMLnpXVIWwqIe5d+qNyS OET8jN6pCDSSrkd7YVCTC/U1UIxXEZ2RPrEyM+2f11DJvXNZLm8KKlayIQwQkNzdWYtN ZLdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714285727; x=1714890527; 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=bhTpgu2EcW8FOgLUoxe1yrL61m/hQexsGPRA1GFrCmU=; b=KBuHeKfAr2ijwwP7fZAsruIho6YEocW6YwMqhmg3oJSicynkejQrP4mO2ZvtL2LB1G pZLUiZf+149PF7CKEjxPSh3iaDT4YeatZPtozpS4R7ouo0KKv8Y0qBo53GMHsaxrAoYm lAA9SBWLeLLYoQpY1npP4QRL0yvcTtLwbLDDsBxbl5jT4Swu87tPwzxdyzC1/lAf9LYn QM5c1GGvN/mszD8LYQAjxbBe2bbVKtE2qr2rIGnRYXOT1OnlVla+szW+pWroMMP5T/lC 39TtyoMBCCvgHYJXbRuzpzW53kY3E/YDFaZ3xPAWYIFCTcqFH2GQvmItYCQnHM8wIkKE FNqQ== X-Forwarded-Encrypted: i=1; AJvYcCUJgOCAXAXf/iXxxT9KZ3DVwAeZwg8wr6s5M3/UnaL4oeSDymxg36YwMTlqNTX4cTnVFqJ2+tcQlP37DlA1zicWeo1J/dfCAg== X-Gm-Message-State: AOJu0YzuqliiM/IEJeiMqTY3f6efuCzVm5ClKbNclYwfw+jUwf2P6QdY MWL+gPnP1N0xNohqnp2fc5oHkB5i4bBrzPmxpGNy/AmI07T422A/CM9gWDfytOpt+agv0O10WGF Bd2y2o1lIIA0q6n4d7uVT5dT3nhnUeA== X-Google-Smtp-Source: AGHT+IFyEGsdRPHxziKylRY72jaRYRTwV72D0kBrE6pjdMfq820iTp/5f65rQERhnIS/wVwIOO0ckj/8GNoH4Uw5aT0= X-Received: by 2002:a17:90a:7895:b0:2aa:e719:3901 with SMTP id x21-20020a17090a789500b002aae7193901mr6994697pjk.20.1714285726739; Sat, 27 Apr 2024 23:28:46 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <18c42fdbb30.2831.17a3710df6d58f02ca570cc47e197a63@interi.co> <0f64523d-d949-75ed-682b-789fc33fa3b2@php.net> In-Reply-To: Date: Sat, 27 Apr 2024 23:28:33 -0700 Message-ID: Subject: Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type To: Alexander Pravdin Cc: Derick Rethans , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000c936070617223f0b" From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000c936070617223f0b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 27, 2024 at 11:04=E2=80=AFPM Alexander Pravdin wrote: > > All builtin functions that currently accept float also accept decimal. > So users don't need to care about separate function sets, and PHP > developers don't need to maintain separate sets of functions. If any > of the parameters is decimal, they return decimal. Float parameters > are converted to decimals implicitly according to the conversion rules > mentioned above. > > So, as I mentioned months ago, this is the reason that having actually looked into implementing things like this, I was interested in using a library. Proposing this is fine. But doing a fully custom implementation that includes this? You're going to implement `sin` and `cos` and `atan` for 128-bit decimals? When we could use an open source library that has a compatible license instead and is proven to work for these already instead, likely with better performance as well? This is likely to be more work than doing a type backed by a library while also being less capable. I know that your shift in proposal here is not aimed at me, and also I'm not a voter so in that sense it doesn't matter. But if this is what the proposal ends up being, I'll probably just continue on the research for an actual arbitrary precision implementation based on MPFR instead of helping with this implementation. Jordan --000000000000c936070617223f0b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Apr 27, 2024 at 11:04=E2=80= =AFPM Alexander Pravdin <alex.= pravdin@interi.co> wrote:

All builtin functions that currently accept float also accept decimal.
So users don't need to care about separate function sets, and PHP
developers don't need to maintain separate sets of functions. If any of the parameters is decimal, they return decimal. Float parameters
are converted to decimals implicitly according to the conversion rules
mentioned above.


So, as I mentioned months ago, this is= the reason that having actually looked into implementing things like this,= I was interested in using a library. Proposing this is fine. But doing a f= ully custom implementation that includes this? You're going to implemen= t `sin` and `cos` and `atan` for 128-bit decimals? When we could use an ope= n source library that has a compatible license instead and is proven to wor= k for these already instead, likely with better performance as well?

This is likely to be more work than doing a type ba= cked by a library while also being less capable.

I know that your shift in proposal here is not aimed at me, and also I&#= 39;m not a voter so in that sense it doesn't matter. But if this is wha= t the proposal ends up being, I'll probably just continue on the resear= ch for an actual arbitrary precision implementation based on MPFR instead o= f helping with this implementation.

Jordan
--000000000000c936070617223f0b--