Re: Zero-fill right shift.
| From: | Andrea Faulds | Date: | Tue, 03 Feb 2015 16:26:13 +0000 |
| Subject: | Re: Zero-fill right shift. | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81728@lists.php.net to get a copy of this message | ||
> On 3 Feb 2015, at 16:22, Leigh <leight@gmail.com> wrote:
>
> On 3 February 2015 at 15:02, Andrea Faulds <ajf@ajf.me> wrote:
>>
>> Why would it be promoted?! The high bit is the 63rd bit. It fits within a long.
>
> because
>
> On 3 February 2015 at 16:08, Andrea Faulds <ajf@ajf.me> wrote:
>>
>> $ sapi/cli/php -r '$x = 1 << 63; debug_zval_dump($x);'
>> bigint(9223372036854775808) refcount(2)
Yeah, I see your point now, although I’d question *why* you need to mess with the high bit.
You can still do ^ -1 or something as usual, though.
--
Andrea Faulds
http://ajf.me/