You are here: Re: & behaves differently « PHP Programming Language « IT news, forums, messages
Re: & behaves differently

Posted by d on 09/30/68 11:41

<fritz-bayer@web.de> wrote in message
news:1141409437.320652.250950@t39g2000cwt.googlegroups.com...
> Are you serious about this? I mean you are right that it should be
> zero, but could it be, that I have to use a different expression? Or
> use a function instead of using the & ? Have you tried it yourself on
> your machine? Do you get the same result?

Those numbers are straight from a test I did on my machine. If you look at
those numbers expressed in binary, you can see that a bitwise and will
return 0, as there is only one bit set to 1 in the second number, and the
corresponding bit in the first number is a 0, hence the result of the
bitwise and is 0.

If perl gives you a different number, then perl either wasn't doing a
bitwise and (though the perl docs say otherwise), or you were using
different numbers...

cheers!

dave

 

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

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