Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121213 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97826 invoked from network); 3 Oct 2023 09:13:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Oct 2023 09:13:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6989818005C for ; Tue, 3 Oct 2023 02:13:29 -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,HTML_MESSAGE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 02:13:28 -0700 (PDT) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 33E834011B; Tue, 3 Oct 2023 18:13:24 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1696324404; bh=rKwdmuA33kqciCqcImAd/r59IZV6+QeKe6JoCb99W/E=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=TSWKdk7t/Fnj0BEzWKFck89cnuEVQUY9js0nM0igfmUuZODLmIdlcFHIP3GgEuddf 0HJDGP4AqtcWq7CNF1o/OfxQ6EbXMEfNt8RxlVEIspyPmmzMdbqkQY4KU9m40RLVXS zTVIUOcXwoC9QMDScrwjvnzHLMI393nz/2qnJeHc= Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_30445C46-8EBD-4453-B1B6-8C295163D0D8" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Date: Tue, 3 Oct 2023 18:13:11 +0900 In-Reply-To: Cc: Jorg Sowa , PHP internals To: Pierre Joye References: <89C362E8-1D89-4F43-AE01-FAA286CC8343@sakiot.com> X-Mailer: Apple Mail (2.3731.700.6) Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: saki@sakiot.com (Saki Takamachi) --Apple-Mail=_30445C46-8EBD-4453-B1B6-8C295163D0D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > yes, they do, as do almost all floating points implementation.=20 >=20 > 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.=20 >=20 >=20 > 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. Regards. Saki= --Apple-Mail=_30445C46-8EBD-4453-B1B6-8C295163D0D8--