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

- Thread: https://staging.externals.io/message/113902
- Original archive: https://news-web.php.net/php.internals/113902
- Started by G. P. B. on 2021-04-01T11:39:33+00:00
- Messages: 4
- RFC: Deprecate implicit non-integer-compatible float to int conversions (Implemented (PHP 8.1)) — https://staging.externals.io/rfc/implicit-float-int-deprecate.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://staging.externals.io/search.md?q={query} · RFCs at https://staging.externals.io/rfc.md · JSON API at https://staging.externals.io/api · documentation at https://staging.externals.io/llms.txt

---

## #113902 — G. P. B. — 2021-04-01T11:39:33+00:00

URL: https://staging.externals.io/message/113902#113902

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

---

## #114051 — G. P. B. — 2021-04-14T11:40:38+00:00

URL: https://staging.externals.io/message/113902#114051 · In reply to: #113902

> 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

---

## #114061 — Hans Henrik Bergan — 2021-04-17T14:30:05+00:00

URL: https://staging.externals.io/message/113902#114061 · In reply to: #114051

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



> 
>
> > […]
> such
> > […]
>
> 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

---

## #114062 — Nikita Popov — 2021-04-17T14:43:48+00:00

URL: https://staging.externals.io/message/113902#114062 · In reply to: #114061

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


> 
>
> > […]
