Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7693 invoked by uid 1010); 9 Feb 2006 19:33:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7677 invoked from network); 9 Feb 2006 19:33:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 19:33:53 -0000 X-Host-Fingerprint: 80.123.98.46 unknown Received: from ([80.123.98.46:7121] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1C/1B-35443-E199BE34 for ; Thu, 09 Feb 2006 14:33:50 -0500 Message-ID: <1C.1B.35443.E199BE34@pb1.pair.com> To: internals@lists.php.net Date: Thu, 09 Feb 2006 20:33:53 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <1139511219.23993.19.camel@ganges.spikesource.com> <43EB9304.6040104@lerdorf.com> <1139512811.23993.36.camel@ganges.spikesource.com> In-Reply-To: <1139512811.23993.36.camel@ganges.spikesource.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.123.98.46 Subject: Re: [PHP-DEV] Other Integers for php 6 From: mike@php.net (Michael Wallner) Ezra Nugroho wrote: > I probably should say integers that I can modify with bitwise operators > comfortably without changing the signs. The problem is that people may > want to do comparison after doing bitwise operations. If the sign is > changed, the comparison will not be valid, right? > > That's why I want to stay within the positive range. You just don't care about signedness: mike@honeybadger:~/development/testimonials$ ./un_or_signed -1 4294967295 4294967295 -1 EQUAL mike@honeybadger:~/development/testimonials$ cat un_or_signed.c #include int main(int argc, char *argv[]) { signed i1 = -1; unsigned i2 = -1; printf("%d %u %u %d %s\n", i1, i2, i1, i2, i1==i2?"EQUAL":"DIFFER"); return 0; } Regards, -- Michael - http://dev.iworks.at/ext-http/http-functions.html.gz