Add bcdivmod() to BCMath

From: Date: Tue, 25 Jun 2024 09:11:10 +0000
Subject: Add bcdivmod() to BCMath
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi internals,

I've been working on improving performance of BCMath lately, and I found that I can get the div
and mod in one calculation. This is obviously faster than calculating it twice separately.

Do you think there's a demand for this feature?

e.g.
```
[$quot, $rem] = bcdivmod('123', '2');
// $quot is '61', $rem is '1'
```

The naming and return value scheme is inspired by Python and Ruby.

Of course, if this is added, equivalent functionality will be added to the Number class.

Regards,

Saki


Thread (11 messages)

« previous php.internals (#123812) next »