On Tue, Sep 26, 2023, at 10:39 AM, Marc Bennewitz wrote:
> Hi internals
>
> I'd like to put a new RFC under discussion:
> https://wiki.php.net/rfc/integer-rounding
>
> Best,
> Marc

I'm honestly kind of confused by this.  The basic concept, as I understand it, 
is sound.  But the rest of the description seems to suggest that the returned 
type will depend on the passed-in type?  That makes little sense to me.  Since 
we already know that int is contravariant to float, I would expect round to 
return int if it can, float if there is a decimal precision set.  ceil and 
floor should always return ints, unconditionally, because that's literally what 
their purpose is.  But that RFC doesn't say that, which makes me quite confused.

Similarly, the BC shim would therefore be (float)ceil($x), not ceil((float)$x), 
which... I don't think that would even do anything, would it?

--Larry Garfield

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to