Hi On 6/21/26 11:18, ignace nyamagana butera wrote:
Indeed Duration::divmod is the way forward just wondering about the return type. Should it be an array or a immutable DTO with .2 properties quotient and remainder?
For bcdivmod it was a deliberate choice to make the result a 2-tuple, with the expectation that array destructuring is used to consume the return value.
Operation-wise I would agree that “div mod” is the correct thing to do, but I don't think that calling Duration/Duration->(int, Duration) literally divmod is an intuitive API when there's also the other division that does Duration/int->Duration.
Best regards Tim Düsterhus
