Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121277 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31913 invoked from network); 12 Oct 2023 18:24:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Oct 2023 18:24:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1D11B180511 for ; Thu, 12 Oct 2023 11:24:44 -0700 (PDT) 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_H3,RCVD_IN_MSPIKE_WL,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-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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, 12 Oct 2023 11:24:40 -0700 (PDT) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-694ed84c981so1046653b3a.3 for ; Thu, 12 Oct 2023 11:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697135079; x=1697739879; 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=leZ8kB3sh/yj7WR5tB1f+VsT0wXlNPnSGdd1VTEfh00=; b=F2nSRnWb6X3JoGCjf/mlWX6Lng/XP/Bnm4mMgpjpeT8BM3LNCWjeobjSg8tavaNhEo RUEMVvdvTHeO7GxqHPyur3A1ST3FsHhvAl/gvgNCksKnn83pDjk1stSaLUjjNQT2u+B1 59G7A73pOBNoa2Z096U3/Bb7MPFtToZHUTOgx1ujMWoT4qlavN9nqug0H4GX/Gf7PHXc IDhk0ak2Y5qp9p7ZaUbeh9H/Ccn0VZYP0pqMcYoySON9gJCgPSghT2Iel46jzaPgc19m i40dwtw0fO9bRa2bJImR7dErIa3UGP3MM62t8964ApWd7pnYkMN2nBUDrl5MClswJ6na RxXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697135079; x=1697739879; 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=leZ8kB3sh/yj7WR5tB1f+VsT0wXlNPnSGdd1VTEfh00=; b=gYF8RfDn3gBhpXMyKezURShePPVz/ZESZP4Oxs867taEB//aFd0N9ndcTgVX/JF+jL BX6ER1R93rJCQR+UAubWL04GJJhZbXJRDfQmPHjdcUSQsqMr06nk5OdTqrH1FZ51hyvj IRBwxw0jUUC5KUh+73zBA2c+33toSElCrRMJsBtRuE1gft4XeNwpF8Yl90otgZnlJRMA VscOODNjU5oRFgTafRA3YJmMhIRfZeDMor7CHHFFDZzelhbYV9PtDXcdbGjUFqAj+FLv GLhQvzcBNqGQPIqjczzPi/fnciAia5ECtHZl+PCPsPnq04BgJcTD++i5npDeoGpSgAPG +eTA== X-Gm-Message-State: AOJu0YwSKc8lMnmpeNLRwZxlc8ftyRTpHziOb+SGgRPajEzkszvgAfyn IjtKXBzHcQczFHfoqyo0D4SUQe0HMyMBH/qak3yLst7nhOo= X-Google-Smtp-Source: AGHT+IHu84ncdFCFTWh9OrKz0r9xVq0+5LvW+ouprxMgP1vN59/KLLqC8unoTxm1cvThz0en/F5ErOx0NWRLzr/nk8M= X-Received: by 2002:a05:6a20:7d98:b0:161:28e0:9abf with SMTP id v24-20020a056a207d9800b0016128e09abfmr26670209pzj.19.1697135079302; Thu, 12 Oct 2023 11:24:39 -0700 (PDT) MIME-Version: 1.0 References: <9812BAD1-5003-4E91-BB3B-00637B9687AC@sakiot.com> In-Reply-To: <9812BAD1-5003-4E91-BB3B-00637B9687AC@sakiot.com> Date: Thu, 12 Oct 2023 11:24:28 -0700 Message-ID: To: Saki Takamachi Cc: Pierre Joye , PHP internals Content-Type: multipart/alternative; boundary="00000000000089aacc0607890d8e" Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: jordan.ledoux@gmail.com (Jordan LeDoux) --00000000000089aacc0607890d8e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 5, 2023 at 5:27=E2=80=AFAM Saki Takamachi wro= te: > Hi, Pierre > > In fact, I predict that many use cases will be covered by GMP. > > Still, I think that there may be cases where calculation functions like > mainframe BCD are required, such as when calculating money. > > I am unable to decide whether it is correct to deprecate BCMath and only > use GMP. > > I'd like to hear other people's opinions as well. > > Regards. > > Saki > GMP cannot be used in any reasonable way to implement things like sin() or cos(). It is *technically* possible, but not at all reasonable. Now, PHP doesn't natively support trig functions for anything other than normal floats, but things like that are exactly the extended capability that my PHP math library adds. This is required for most statistics, which now HAVE to be done in PHP itself since the ext-stats extension hasn't been updated since... I think 7.1? BCMath is one of the worst and slowest implementations of arbitrary precision decimals. It absolutely should be replaced. I have explored creating a new extension to do just this in fact for the express purpose of deprecating and replacing the bundled BCMath. But GMP, as it is implemented currently, is not a replacement at all. Jordan --00000000000089aacc0607890d8e--