Bluehost.com Web Hosting $6.95

&-operator does not work with big numbers

This is a discussion on &-operator does not work with big numbers within the PHP General forums, part of the PHP Programming Forums category; hello! i think the &-operator has problems with big numbers! a example: /* this works correct */ if((24&8)==...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-01-2003
caszt
 
Posts: n/a
Default &-operator does not work with big numbers

hello!

i think the &-operator has problems with big numbers!

a example:

/* this works correct */
if((24&8)==8) echo "ok<br>";
else echo "not ok<br>";

result:
"ok";

/* this works wrong */
if((35769305792512&2097152)==2097152) echo "ok<br>";
else echo "not ok<br>";

result: "ok";

here are the numbers in the dual-system:

/* 1000001000100000110000110001000000000000000000
1000000000000000000000 */

Thanks,
Caszt
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0