Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43603 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42288 invoked from network); 2 Apr 2009 16:33:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2009 16:33:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.72 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.72 mail1.panix.com Received: from [166.84.1.72] ([166.84.1.72:58080] helo=mail1.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/54-22853-DC8E4D94 for ; Thu, 02 Apr 2009 11:33:17 -0500 Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mail1.panix.com (Postfix) with ESMTP id B597129404 for ; Thu, 2 Apr 2009 12:33:14 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 14662) id 326181A403; Thu, 2 Apr 2009 12:33:18 -0400 (EDT) Date: Thu, 2 Apr 2009 12:33:18 -0400 To: PHP Internals List Message-ID: <20090402163317.GA25864@panix.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [PHP-DEV] [PATCH] double to long conversion change From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Matt: On Sat, Mar 14, 2009 at 09:30:42AM -0500, Matt Wilmas wrote: > > But of course with > doubles, precision has been lost long before 2^63 anyway, as far as > increments of 1 (it's 1024 at 2^63). I just ran into these issues in PHP 5.2.8 on 64 bit Linux while running examples I'm using to improve our documentation surrounding bitwise operators, bindec() and decbin(). The integer float conversions start failing above 2^53, meaning 9007199254740993 is the first integer that doesn't work. As you noted, ints divisible by 1024 are fine. I can provide the test script to anyone who needs it. A bash script I put together makes it look like things work correctly in the shell. So it seems this is a PHP thing, not a Linux thing. Am I correct in believing your changes will take care of these issues? It seems you're looking to patch 5.3 and HEAD. Are there thoughts of applying this to 5.2? Thanks, --Dan Note: The guy who put the box together says everything on it is built against 64 bit libraries. -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409