Re: [PATCH] double to long conversion change

From: Date: Thu, 02 Apr 2009 16:33:18 +0000
Subject: Re: [PATCH] double to long conversion change
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-43603@lists.php.net to get a copy of this message
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

« previous php.internals (#43603) next »