Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122858 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 61F2A1A009C for ; Tue, 2 Apr 2024 13:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712065793; bh=z9RMCD2gK+AuExZ47UNwcG8j5gfqmIV+yQawDrKNB7o=; h=To:Subject:Date:From:In-Reply-To:References:From; b=giErC8umrG1xqiJQCurBi771VTpdPwvWr6LgvHlKz42ENy094mpbB6eNvjMq5OiVQ XPQvPcUk9O4uge4Y0NQP9cOwrDagaDdnV5FoN6raVC0CGCV4B3+WTPAETpv93nY+Mn 5/a9XXmrepYM6ohEWcBexqCcBe8TNWdnZvFx03HvcoyycphE1d/jaH6UuBUhZD0f9g 50PwgzdGKX0Bct3WRdudADidV+t6oF4DhgIPT+vskP7CDktNmUfGoxJl05YRvKUCSE 3l4fnwCAFVozXODsdC6Wd81yjA7HMQDRG/dTvLC9PFoA3dVxZUBjni5OvQ8yLss7uZ k9hUSZPzu7ZLA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0C27180004 for ; Tue, 2 Apr 2024 13:49:51 +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=1.0 required=5.0 tests=BAYES_50,DMARC_MISSING, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,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 gliadin.co.uk (gliadin.co.uk [80.82.115.221]) by php-smtp4.php.net (Postfix) with ESMTP for ; Tue, 2 Apr 2024 13:49:51 +0000 (UTC) Received: by gliadin.co.uk (Postfix, from userid 33) id 05DAFFA28B2; Tue, 2 Apr 2024 16:49:22 +0300 (MSK) To: Subject: Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath X-PHP-Originating-Script: 0:main.inc Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 02 Apr 2024 14:49:21 +0100 In-Reply-To: References: Message-ID: X-Sender: barney@redmagic.org.uk User-Agent: Roundcube Webmail/0.7.1 From: barney@redmagic.org.uk (Barney Laurance) On 2024-04-02 12:26, Saki Takamachi wrote: > Also, an idea occurred to me while reading your comments. > > The current assumption is that a Number always holds a single value. > How if we made it so that it held two values? They are the numerator > and the denominator. Then we'd have a rational number, instead of an arbitrary precision decimal. I think that's a sufficiently different data type that it should be a different class (if required), and probably a separate RFC, and for now it's better to stay closer to the existing BCMath API. Developers should be prepared to accept that an arbitrary precision decimal can't represent 1/3 exactly, just like a binary float can't represent 1/10 exactly.