Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122762 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 AD7241A009C for ; Tue, 26 Mar 2024 18:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1711476036; bh=/JiT2Q5hJI28JlrnZxqCnhWlGTdAy9lbS/RYrB6MJC4=; h=To:Subject:Date:From:In-Reply-To:References:From; b=RVaQ9uU3SfAKVaXjZyqcPXOujyrFF2a5SfgsZLe3ri9qAeUW2HYTgLymAnnnURQ0H 2cwZJvZhIpCzsXlN7owFKsZFc8A5m/DZ9237p6JcyIQe5rJDdBUocR/huuyd6qPNPK 1rxStxMbhnFGO8EaGHAAdOALjtMQJbYfMHWMW1KpKak5jZ3MYrXSeLfKXQSZ8pJh6O i3hEO+FF/IeNxhF/em0XaOgCrbLDzp4rWEm1tZvk1SKre+YBR1cFpNuZkLW4TWY5Yv yC9Yt0hMVTPdvBUxtgiN4dtOKzx0EWEKhB9Krom6NSaDSYTiLUkM8E3Q2I5dhyPf4j R7BonTqm9GbSw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 07057180080 for ; Tue, 26 Mar 2024 18:00:32 +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, 26 Mar 2024 18:00:31 +0000 (UTC) Received: by gliadin.co.uk (Postfix, from userid 33) id 07F1AFA0271; Tue, 26 Mar 2024 21:00:06 +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, 26 Mar 2024 18:00:05 +0000 In-Reply-To: <4F094EDA-5058-407D-AF39-06FD934FDE1F@sakiot.com> References: <4F094EDA-5058-407D-AF39-06FD934FDE1F@sakiot.com> Message-ID: <91111e11ee72ffd18e1a1b2412246d00@gliadin.co.uk> X-Sender: barney@redmagic.org.uk User-Agent: Roundcube Webmail/0.7.1 From: barney@redmagic.org.uk (Barney Laurance) On 2024-03-24 13:13, Saki Takamachi wrote: > I want to start the discussion on the PHP RFC: Support object type in > BCMath. Do we also need `toFloat` and `toInt` functions? Seems like using explicit functions will be safer than casting. For toInt I'd expect an exception if the value is outside the range of possible ints. For toFloat it might be nice to have a flag argument to give the developer the choice of having it throw if the value is outside the range of floats or return INF or -INF, or possibly the user should just check for infinite values themselves.