Reply to Re: Xor bug in all PHP versions

Your name:

Reply:


Posted by Jim Michaels on 01/23/06 22:47

How do you know the PHP lexical analyzer or parser is going to lop off a bit
for you? what if it does something else?
your number in hex is 0xFFFF FFFE E58D 315F ^ 0x0000 0000 0000 AB26=0xFFFF
FFFF 8000 AB26
2's complement numbers in hex are represented differently in binary...
this is from pcalc, a program from analogx.com (64-bit programmer's
calculator)

"Tim Roberts" <timr@probo.com> wrote in message
news:3921t1p8r8imnqmgnijdrpkmeknr1t0ooa@4ax.com...
> "Chung Leong" <chernyshevsky@hotmail.com> wrote:
>>
>>How is -4,738,698,913 ^ 43814 = -443,704,711 correct?
>
> First, answer this question: how can you squeeze -4,738,698,913 into a
> 32-bit variable?
>
> 4,738,698,913 would be 1_1A72_CEA1 in hex, but that needs 33 bits. If you
> truncate that to 32 bits, you get 1A72_CEA1. Xor that with 43,814, which
> is AB26 in hex, and you get 1A72_6587, which just happens to be
> 443,704,711.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация