Re: [VOTE] Deprecate implicit non-integer-compatible float to int conversions

From: Date: Sat, 17 Apr 2021 14:43:48 +0000
Subject: Re: [VOTE] Deprecate implicit non-integer-compatible float to int conversions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-114062@lists.php.net to get a copy of this message
On Sat, Apr 17, 2021 at 4:30 PM Hans Henrik Bergan <divinity76@gmail.com>
wrote:

> just want to double check, 1.000000000000009 will then be an incompatible
> cast to int(1), right? because the  0.000000000000009 will be lost?
>

That's right. Something to keep in mind is that your example could have
just as well been 0.9999999999999999 -- which is going to be 0 when cast to
an integer, not 1. A "negligible" difference of 10^-16 in a float can
easily become a difference of 1 when interpreted as an integer.

Nikita


> On Wed, 14 Apr 2021 at 13:41, G. P. B. <george.banyard@gmail.com> wrote:
>
> > On Thu, 1 Apr 2021 at 12:39, G. P. B. <george.banyard@gmail.com> wrote:
> >
> > > Hello internals,
> > >
> > > It's been a couple of weeks and no further comments have been made as
> > such
> > > voting is now open:
> > >
> > > https://wiki.php.net/rfc/implicit-float-int-deprecate
> > >
> > > It will run for two weeks until the 14th of April 2021.
> > >
> > > Best regards,
> > >
> > > George P. Banyard
> > >
> >
> > I'm happy to announce that this RFC has been unanimously approved with 29
> > votes in favor and 0 against.
> >
> > Best regards,
> >
> > George P. Banyard
> >
>


Thread (4 messages)

« previous php.internals (#114062) next »