Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21826 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12977 invoked by uid 1010); 9 Feb 2006 19:49:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12961 invoked from network); 9 Feb 2006 19:49:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 19:49:29 -0000 X-Host-Fingerprint: 209.10.209.56 unknown Linux 2.4/2.6 Received: from ([209.10.209.56:43255] helo=mail.spikesource.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 55/CB-35443-9CC9BE34 for ; Thu, 09 Feb 2006 14:49:29 -0500 Received: from ganges.spikesource.com (ganges.spikesource.com [::ffff:172.16.20.210]) (AUTH: PLAIN enugroho, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by mail.spikesource.com with esmtp; Thu, 09 Feb 2006 11:49:19 -0800 id 0021442E.43EB9CBF.00001E91 Reply-To: enugroho@spikesource.com To: internals@lists.php.net Organization: SpikeSource Inc. Date: Thu, 09 Feb 2006 11:49:09 -0800 Message-ID: <1139514549.23993.51.camel@ganges.spikesource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_amazon-7825-1139514559-0001-2" X-Mailer: Evolution 2.0.4 (2.0.4-7) Subject: [Fwd: Re: [PHP-DEV] Other Integers for php 6] From: enugroho@spikesource.com (Ezra Nugroho) --=_amazon-7825-1139514559-0001-2 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Seth Price corrected me (thanks Seth!). I actually only loose one bit for the sign. echo (int)pow(2, 31); > 1073741824 echo (int)pow(2, 32); > -2147483648 That's certainly a relief. I don't know if there are other reasons to have unsigned integers. I certainly don't mind having it. However it is probably a small issue since PHP automatically cast large numbers to float anyway. Thank you all, Ezra --=_amazon-7825-1139514559-0001-2 Content-Type: message/rfc822 Content-Disposition: inline Content-Description: Forwarded message - Re: [PHP-DEV] Other Integers for php 6 Delivered-To: enugroho@spikesource.com Return-Path: Received: from mail1.spikesource.com (mail1.spikesource.com [::ffff:209.10.209.41]) by mail.spikesource.com with esmtp; Thu, 09 Feb 2006 11:26:46 -0800 id 00214470.43EB9776.00000DEC Received: from fafner.doit.wisc.edu ([144.92.197.155] helo=smtp6.wiscmail.wisc.edu) by mail1.spikesource.com with esmtp (Exim 4.44) id 1F7HGV-0007D2-6y for enugroho@spikesource.com; Thu, 09 Feb 2006 11:15:39 -0800 Received: from avs-daemon.smtp6.wiscmail.wisc.edu by smtp6.wiscmail.wisc.edu (iPlanet Messaging Server 5.2 HotFix 2.08 (built Sep 22 2005)) id <0IUF00B5MPBM4J@smtp6.wiscmail.wisc.edu> for enugroho@spikesource.com; Thu, 09 Feb 2006 13:11:46 -0600 (CST) Received: from [10.175.232.50] (209-254-158-245.ip.mcleodusa.net [209.254.158.245]) by smtp6.wiscmail.wisc.edu (iPlanet Messaging Server 5.2 HotFix 2.08 (built Sep 22 2005)) with ESMTPSA id <0IUF00618PBJEK@smtp6.wiscmail.wisc.edu> for enugroho@spikesource.com; Thu, 09 Feb 2006 13:11:45 -0600 (CST) Date: Thu, 09 Feb 2006 13:11:34 -0600 From: Seth Price Subject: Re: [PHP-DEV] Other Integers for php 6 In-reply-to: <1139511219.23993.19.camel@ganges.spikesource.com> To: enugroho@spikesource.com Message-id: <2B49B3B8-7FFF-4175-A3E0-82C8A9D12538@wisc.edu> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.746.2) X-Spam-Report: AuthenticatedSender=yes, SenderIP=209.254.158.245 X-Spam-PmxInfo: Server=avs-6, Version=5.1.2.240295, Antispam-Engine: 2.2.0.0, Antispam-Data: 2006.02.09.105105, SenderIP=209.254.158.245 References: <1139511219.23993.19.camel@ganges.spikesource.com> It only requires one bit to determine a sign. So a 32 bit integer can represent the same values of a 31 bit unsigned integer. ~Seth On Feb 9, 2006, at 12:53 PM, Ezra Nugroho wrote: > PHP developers, > > Are the requirements for PHP 6 set in stone? > > I saw in the minutes from the Paris meeting that a 64bit integer has > been proposed. I am curious if it would make sense to allow > integers to > be both signed and unsigned. For me personally, I would love to have > unsigned 64bit integers. > > I have a task that requires bitflag operations. Having only 16 bits to > deal with is really bad (I only care about positive int). Having 32 > positive bits in PHP 6 is certainly an improvement, but if I can > get all > 64, then live would be much better. > > http://www.php.net/~derick/meeting-notes.html#add-a-64bit-integer > > Thanks, > Ezra > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=_amazon-7825-1139514559-0001-2--