Re: Add bcdivmod() to BCMath

From: Date: Tue, 25 Jun 2024 17:15:20 +0000
Subject: Re: Add bcdivmod() to BCMath
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-123829@lists.php.net to get a copy of this message
---- On Tue, 25 Jun 2024 17:29:58 +0100 Saki Takamachi wrote --- > > Also, it is not practical to record the remainder in the Number object resulting from the > division. This is because there can be objects whose division results are equal but whose remainders > are different. > > In the discussion of the Number class, it was argued that objects should not have too much > state. > > Increasing the state of surplus is not desirable in this respect, as it contradicts the > previous argument. If anything I was thinking of recording the remainder in the the original number object, not the one returned (or possibly in something like a WeakMap keyed to it). So it does increase state and makes it technically no longer immutable, but that change in state would not be detectable from outside except by profiling performance. It's state that would have to be ignored in the equality check.

« previous php.internals (#123829) next »