Reply to Re: & behaves differently

Your name:

Reply:


Posted by Jerry Stuckle on 11/03/42 11:41

fritz-bayer@web.de wrote:
> Hi,
>
> why does the php expression
>
> $result = 5543039447 & 2147483648;
>
> when executed evaluate to 0, whereas the perl expression
>
> $same = 5543039447 & 2147483648 ;
>
> evaluate to 2147483648 ???
>
> Fritz
>

Because Perl is using 64 bit integers and PHP is using 32 bit integers.

2147483648 is not a valid value in 32 bit arithmetic. The largest value
you can have is 2147483647.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[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

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