Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124553 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 0581A1A00B7 for ; Tue, 23 Jul 2024 06:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721716191; bh=ILbe/9s6J3yv+eBnI9gVCAV6qABQ+M7mBAmnCaNhnqU=; h=From:Subject:Date:References:In-Reply-To:To:From; b=BGVAcMS8sDM4Re1/0beUWdBbFADSxUfQuwD4SgFeCcwsEU92tk+WPKOvtGAgJxhew TejKIx88vCITf0v1k4tGYx7pYRpn2FeiRGz/T3IpnbkkElao4cuhhBmUvGJoo4ucu+ /USj3kkrukqHkmN6TUNrrKgcPuBaJf+1DuZ+40uuDPGNiTe66iXal+4p2c1eWPGEJ6 c3rSVw5PftNZP7sYcvCijguH/G4Fo+oZtE5hxmyFJsObdh9BGU4q1uTf2OWDZQO1AM nGAC0GRMOnEPImVcKwbOeUxHMMXRWFgyvTf0WrdlmGSy+ejPIUs1LmfKPc51Tjklm0 zAOulThNr2xKg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1495180039 for ; Tue, 23 Jul 2024 06:29:49 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jul 2024 06:29:49 +0000 (UTC) Received: from smtpclient.apple (161.148.159.133.rev.vmobile.jp [133.159.148.161]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id D433A401CD for ; Tue, 23 Jul 2024 15:28:12 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1721716092; bh=ILbe/9s6J3yv+eBnI9gVCAV6qABQ+M7mBAmnCaNhnqU=; h=From:Subject:Date:References:In-Reply-To:To:From; b=mL5VYSYbQ1SlrCbhY8uN2RVL6lbO3S7oNVN5dazDbeatN0fgVoCnKOBGzrLeJw0oo dTCPs5iTAZM/opU+9l2e1i3Ru7BvPWEwtpA3/iQpeSRbxmA527bF4YY7m2XkLx6S3J 7U9FQMlNtlgL9u7R67JchqX0ufooezEQMiHQsLgo= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: [PHP-DEV] Re: bcmod() behavior is different from what I expected Date: Tue, 23 Jul 2024 15:27:59 +0900 Message-ID: References: In-Reply-To: To: PHP Internals X-Mailer: iPhone Mail (21F90) From: saki@sakiot.com (Saki Takamachi) >> =EF=BB=BFHi internals, >>=20 >> I noticed that `bcmod()` behavior is a little different from what I expec= ted. >>=20 >> First, look at the following code for `bcdiv()`: >> ``` >> bcdiv('99', '100', 2); // '0.99' >> ``` >>=20 >> So what should the following code be? >> ``` >> bcmod('99', '100', 2); >> ``` >>=20 >> The result is `'99.00'`. >> I was expecting `'0.00'` for this. I thought that if gave `bcdiv()` and `= bcmod()` the exact same arguments, their results would not contradict each o= ther. >>=20 >> To me this is unexpected behaviour, how do you think? >>=20 >> Regards, >>=20 >> Saki >=20 > However, considering the behavior of `fdiv()` and `fmod()`, the current be= havior of `bcmod()`may be correct and my thinking may be wrong... >=20 > Saki I was probably tired. Please forget about this thread... Saki=