On 26.08.2022 at 01:29, Larry Garfield wrote:
> On Thu, Aug 25, 2022, at 3:16 PM, Rowan Tommins wrote:
>
>> But then we face the awkward asymmetry of the current functionality:
>>
>> intdiv() - Integer division
>> / - Floating-point division
>> % - Integer modulus
>> fmod() - Floating-point modulo
On Thu, Aug 25, 2022, at 3:16 PM, Rowan Tommins wrote:
> But then we face the awkward asymmetry of the current functionality:
>
> intdiv() - Integer division
> / - Floating-point division
> % - Integer modulus
> fmod() - Floating-point modulo
>
> Apparently as of PHP 8.0, there is also an fdiv() f
On 25/08/2022 12:33, Peter Bowyer wrote:
Is this not one time where using a flag to change a function's behaviour
makes sense? So rather than fdiv, floor_div, int_div (etc) we have div($1,
$2, DIV_FLOAT), div($1, $2, DIV_FLOOR), div($1, $2, DIV_INT).
I'm not proposing div (non namespaced) as t
On Tue, 23 Aug 2022 at 19:09, David Gebler wrote:
> I can just see floor_div and floor_mod getting mixed up
> with fdiv and fmod but maybe I'm overthinking it, maybe it wouldn't really
> be an issue. Maybe there's alternative names you could give them though
> again I suspect the ones you've chos
On Tue, Aug 23, 2022 at 6:27 PM Daniel Wolfe wrote:
>
> If we do go down the operator route, however, what tokens should be
> chosen? `%%` makes since for floor modulo, but `//` is already used for
> comments.
>
Yeah I appreciate it is tricky, because // is pretty much the only
obviously sensibl
On 2022-08-22 11:49 AM, David Gebler wrote:
The bit I think I might not like is these being functions, floor_div and
floor_mod. They may be easily confused with the similarly named and
existing fdiv and fmod functions. Wouldn't new operators, // and %%
respectively, be preferable?
Speaking to
On Mon, Aug 22, 2022 at 4:22 AM Daniel Wolfe wrote:
> For the first four instances, the function works as intended since the
> timestamps are non-negative numbers. However, for the fifth example,
> since the date is before 1970, the timestamp is going to be negative
> resulting in an ostensible a
On 2022-08-21 3:59 PM, Rowan Tommins wrote:
Could you give some quick examples of when these functions would give different answers,
and why someone might need / want the "floor" variants?
My hobby is fiddling with calendrical calculations, and, if you need a
perfect subject area where the fl
On 21/08/2022 21:30, Daniel Wolfe wrote:
I have a fork on Github that adds functions named `floor_div` and
`floor_mod` which implement the floor technique. Before I submit a pull
request and write up an RFC, what are your thoughts or concerns about
adding this to PHP?
Could you give some qui