bcmod() behavior is different from what I expected
| From: | Saki Takamachi | Date: | Tue, 23 Jul 2024 03:01:47 +0000 |
| Subject: | bcmod() behavior is different from what I expected | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-124551@lists.php.net to get a copy of this message | ||
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 bcmod() the exact same arguments, their results would not contradict each other.
To me this is unexpected behaviour, how do you think?
Regards,
Saki