You are here: Re: Xor bug in all PHP versions « PHP Programming Language « IT news, forums, messages
Re: Xor bug in all PHP versions

Posted by Tim Roberts on 01/20/06 08:59

"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.

 

Navigation:

[Reply to this 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

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