Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121212 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93034 invoked from network); 3 Oct 2023 07:41:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Oct 2023 07:41:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C60221804B0 for ; Tue, 3 Oct 2023 00:41:15 -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-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 00:41:15 -0700 (PDT) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-69335ddbe16so450973b3a.1 for ; Tue, 03 Oct 2023 00:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696318874; x=1696923674; 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=mj33JXLK0kvQu3kSTbUXVcRXwCbhpMgpHKFra9gLleM=; b=ewEZy9pnS+DdcNmnSSfsT4AMi8UfqPI6Z4MdN7YEcmeIrruhBUufNG+KN7JP38huOR VSzedPk5/Bg0YyFf9aZtwcoQKgkSf5hItOg961K+lrQqB0ZozA9Ku2KxTJhHwr/bhpMF a8GwlmcsAIGBCql0AVjnstuFrV6lCcbBaJ/rY1b8z9xq51oh4h/hRJD57gH5BDrgcdVW +todDFkCKRYeorJO2LSz9C9eofElZgsPsc/xuIqdEhpJ1X8BvuSTExOnaUIFYOCx/6Zc sXDqWVRqrbLU/QO/ooV2GyP9cCsACkpN+jWkztfKOzp8OjgZLXVED0LmZGpXNhjDSOuB Al6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696318874; x=1696923674; 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=mj33JXLK0kvQu3kSTbUXVcRXwCbhpMgpHKFra9gLleM=; b=s/Q/OBXZSJR63q+vvWed+8gM438jquVQDh1kMFOkaL03SG6X7Y4ZOMCE7t4DJsFS8G v6ds0DGCV3MsmyBWjnYeZ6VYtsddswOjHWh9IzaDcaKcpTkNL+j3XBBUuDz6spFHpbVM O/d3WNnR1kSSRks0k1xjEcdwD25mCILzmAIRpg/yMeNlGZDE7iG+U7jgwnh+USlDCSCg +37LmWXXrwt+ijEBkuAEJIEUigJhVjYqer4LxoOazikEnVLGdYmnL/VLimZAmj9wjtxM EqBsl0jq9df94cAUHIGrawdzm8fISLqPdrIzVcITn39EQSTsIMHVtAVq6yobavYzj2Yh BA9Q== X-Gm-Message-State: AOJu0Yx3wy3Eq01CM89isVDngKF9exe6JLQKKf16rNtjx73Fw7W/m7It HAhsOQ2GW31ciwDYr3bnTPYM6rxj/pa1FzC6NsI= X-Google-Smtp-Source: AGHT+IHw7W5+RrgtbCoxlDm2caIy5TFWqPxjVvxLUzlNodvy1NjKvyyG/Zznb7V2G5nu6WdUvT1CsojUIzSnAvVI168= X-Received: by 2002:a05:6a00:852:b0:690:463a:fa9d with SMTP id q18-20020a056a00085200b00690463afa9dmr14060896pfk.22.1696318874083; Tue, 03 Oct 2023 00:41:14 -0700 (PDT) MIME-Version: 1.0 References: <89C362E8-1D89-4F43-AE01-FAA286CC8343@sakiot.com> In-Reply-To: <89C362E8-1D89-4F43-AE01-FAA286CC8343@sakiot.com> Date: Tue, 3 Oct 2023 14:41:01 +0700 Message-ID: To: Saki Takamachi Cc: Jorg Sowa , PHP internals Content-Type: multipart/alternative; boundary="000000000000ea65f20606cb03c8" Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: pierre.php@gmail.com (Pierre Joye) --000000000000ea65f20606cb03c8 Content-Type: text/plain; charset="UTF-8" On Tue, Oct 3, 2023, 12:25 PM Saki Takamachi wrote: > > I thought GMP was a function for integers, so I wasn't expecting that tbh. > > However, even if GMP supported floating point numbers, wouldn't it end up > having the inherent error problem of floating point numbers? > 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 best, > --000000000000ea65f20606cb03c8--