Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121216 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4695 invoked from network); 3 Oct 2023 10:22:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Oct 2023 10:22:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6BE2B1804C1 for ; Tue, 3 Oct 2023 03:22:43 -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-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 ; Tue, 3 Oct 2023 03:22:43 -0700 (PDT) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-584a761b301so462396a12.3 for ; Tue, 03 Oct 2023 03:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696328562; x=1696933362; 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=7AQtsBiGPV+eGoqR2WbcD6W6pA56uyjEiPToU9x00AQ=; b=KfF846ouU3TEkADHHJeysU5YxIjELCmARvBJFI5XuVZwXvGirTdRODroB5vIFoq+6a Nrf6wSe1+Rm04wqv9cH3zidPHDlFiPUvndFCREB7nVqS1OerQ/8hiNGMkMl0+kZAxFaS 3C5vSNCoeJSvZTk0R79ZJfy8I94wPjGLb2f7dWjJyi90RBziyr2Wv+duk7d00cZg3i92 hrTF84IARtFsqO8sQMMAn5Sqd14HE1LlNEtH2leHaiKKO1VQSt5/stcq7WAOTY679wWn QE6rCfM577oyGgn/WXgoYYHoWX6QEq0EtYJS+0wanz5xZELdrmHC5avekZVKnuTYLMeD i8/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696328562; x=1696933362; 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=7AQtsBiGPV+eGoqR2WbcD6W6pA56uyjEiPToU9x00AQ=; b=TPfC/ecgDEsbLbNu2kN5M/PltNVR0haa0+rk4v58XA2auxFqJdjV0CeJa9M0/CisY2 Tw+2yq1tbrBVMoR8RxGTfOzW1cjlGLgRB4QvDTIWK8gvgfRgAO8Df8rw4PyENUkgpNJt 0qGVuJzRMJKlwey8JtDSfe/1Z7z7+dFWXfpPwel+mK+J+ZQ3nyr7X4zQ9BeQNhdMHk5a 5qzPRMhqouBXGwbBaIFIO2DNcUPvNOPjNCFLhH+lD/CxkP7kZhVzcYM/NOs+rWXkj9sI bTG26kLUE7v493wAb551UDGW0CgX8kKPaL2LozRngj2WGTPKXUnzg3DzQj9c63PF0EON pQyA== X-Gm-Message-State: AOJu0YxYw7yoEhMowd0vcW2SW1iQsF27JD+BdTUlxEzGys0unJINLith WoMRAjbVzST8quCSYtX0CAlsm2yUrk69yB7nLcE= X-Google-Smtp-Source: AGHT+IF1wp3YmSqEk9eCTxMQPwBqTQ6d9elO0YhyWi+bluGhIxHPgfQueqv1rkdMNpj8YAE4jGMeVZRm1K8ei7+s9EY= X-Received: by 2002:a05:6a20:a110:b0:148:f952:552b with SMTP id q16-20020a056a20a11000b00148f952552bmr16527450pzk.51.1696328561691; Tue, 03 Oct 2023 03:22:41 -0700 (PDT) MIME-Version: 1.0 References: <89C362E8-1D89-4F43-AE01-FAA286CC8343@sakiot.com> In-Reply-To: Date: Tue, 3 Oct 2023 17:22:30 +0700 Message-ID: To: Saki Takamachi Cc: Jorg Sowa , PHP internals Content-Type: multipart/alternative; boundary="0000000000005795c40606cd4583" Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: pierre.php@gmail.com (Pierre Joye) --0000000000005795c40606cd4583 Content-Type: text/plain; charset="UTF-8" On Tue, Oct 3, 2023, 4:13 PM Saki Takamachi wrote: > yes, they do, as do almost all floating points implementation. > > Memory limited float values and their respective operations are still > useful in many areas, but financial values and the likes. Scaled integers > are the way for accuracy. > > > Also, side note, gmp recommends to rely on https://www.mpfr.org/ for > accurate FP operations > > > Hi > > This seems to be a floating point number with extremely high precision > compared to regular long doubles. However, as you say, even though the > accuracy is very high, errors still occur. (the error is so small that it > almost never becomes a problem.) > > By its very nature, BCMath does not introduce any errors. It is debatable > whether floating point calculations in GMP can play the role of BCMath. > so does gmp. The point made about gmp earlier is more about the sustainability of gmp vs bcmath. --0000000000005795c40606cd4583--