> On 18 בפבר׳ 2015, at 19:50, Rasmus Lerdorf <ras...@lerdorf.com> wrote: > > On 02/18/2015 08:51 AM, François Laupretre wrote: >>> De : Pádraic Brady [mailto:padraic.br...@gmail.com] >>> >>> Careful, it helps not to call folk "radicals" if you intend to pursue >>> a compromise with them ;). >> >> Sorry, english is not my native language, and 'radical' may be offensive. >> >> I was just looking for a word for people who consider providing two modes is >> a pre-requisite to any discussion. >> >>> I wouldn't necessarily mind int->float - it's lossless assuming one way >>> only. >> >> It's lossless but it kills the 'strict' position. It can be claimed, one >> hand on the heart, this will be the only exception but, as use cases and >> side effects accumulate, we all know it will finish as a bunch of exceptions >> to a no-more strict mode, adding confusion where it is not needed. I guess >> the next one would be (int -> bool), and the rest would follow. > > We need to keep in mind that int->float isn't technically lossless. We > have a 53-bit IEEE754 mantissa to take account for here, so it is only > lossless for values below 36028797018963966 or so.
We can limit ourselves to values below that limit. If you deal with values above it, be explicit about casting. Zeev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php