Re: [DRAFT][RFC] Big Integer Support
| From: | Nikita Popov | Date: | Fri, 20 Jun 2014 14:58:30 +0000 |
| Subject: | Re: [DRAFT][RFC] Big Integer Support | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75021@lists.php.net to get a copy of this message | ||
On Fri, Jun 20, 2014 at 2:35 AM, Andrea Faulds <ajf@ajf.me> wrote:
> Good evening again,
>
> I’ve been working on a patch to add bigints to PHP for more than a
> fortnight now. It’d based on the phpng branch and very much unfinished, but
> is somewhat working.
>
> A draft RFC is available here: https://wiki.php.net/rfc/bigint
>
> It’s quite far from done, but I wanted to start some discussion now as
> finishing the patch will take some time.
>
> Thanks!
>
Hey Andrea, this looks really interesting!
Could you please submit a PR from your branch, so it's possible to review
the code?
Regarding the RFC text, I think you mixed up some left and right shifts.
"<< 65 will result in zero" is probably supposed to be >> 65? And "right
shifts will promote to bigints" probably is talking about left shifts?
Btw, I wouldn't worry about the change in shifts larger than the integer
width. Those have always been UB inherited from using UB of the C language.
The cyclic behavior is only an idiosyncrasy of the x86 architecture - other
ISAs like ARM (iirc) will not exhibit the behavior.
Nikita