Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124551 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 ED5411A00B7 for ; Tue, 23 Jul 2024 03:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721703818; bh=3xf+lSCGb6m8zskQOeg/nVvgAhbMizp49fTXM7erPJM=; h=From:Date:Subject:To:From; b=AFbMh+qHSkLwC9ren04qm092W5XkNf9M3sePRG6JfKjkBAqA40lndFWJ9P8aIEr38 XMV4KX++gtSUPkLgWpGo6OpXe3Ya6wYIHVmMw9DHnEzojUSLf60DCYZufG4EdUQCmQ Da/eYJ4Ous1xfifN/6ZeqDzPEc61ZvQ8842TU2dirs51benlyDDtH02+xGO1pzWOXa A+NuvNzfq6khGxFUIshY9T+Ty+XvifPhK11g6SCtVAioz4ES3jJ3qRk7Z7B7YjOmir VEDU/ntRwxkq7CQZHl21BLKxRKmNVMXitVRK8+rQPFfeEXjjOhaLKA7bDbFbVNze5y 7yp++4E4Q9NIw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C17A5180057 for ; Tue, 23 Jul 2024 03:03:36 +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 03:03:35 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (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 0F10B401CD for ; Tue, 23 Jul 2024 12:02:00 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1721703720; bh=3xf+lSCGb6m8zskQOeg/nVvgAhbMizp49fTXM7erPJM=; h=From:Date:Subject:To:From; b=mthvpj2wISJcBC4f25FOJx8KDUee6QgBySuD+hedMvWvgFSZ3bY/2iJ7mE6Ar/PXY WvBmspa0EJpG/3Z6LRtx9/2I/xL76yinx/zl/5WpndqOne+78KbtgcZuQaMi3rbC0A obd7oYilhT9v1nLNjUow85ss9cE8dj9Qwt8+iJ9k= Content-Type: text/plain; charset=us-ascii 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) Date: Tue, 23 Jul 2024 12:01:47 +0900 Subject: [PHP-DEV] bcmod() behavior is different from what I expected Message-ID: <0F3CC580-7A03-4212-A117-715D5B1AA2BD@sakiot.com> To: PHP Internals X-Mailer: iPhone Mail (21F90) From: saki@sakiot.com (Saki Takamachi) Hi internals, I noticed that `bcmod()` behavior is a little different from what I expected= . First, look at the following code for `bcdiv()`: ``` bcdiv('99', '100', 2); // '0.99' ``` So what should the following code be? ``` bcmod('99', '100', 2); ``` The result is `'99.00'`. I was expecting `'0.00'` for this. I thought that if gave `bcdiv()` and `bcm= od()` the exact same arguments, their results would not contradict each othe= r. To me this is unexpected behaviour, how do you think? Regards, Saki=