Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42920 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80454 invoked from network); 4 Feb 2009 18:03:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2009 18:03:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=kkooporation@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kkooporation@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.132.250 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kkooporation@googlemail.com X-Host-Fingerprint: 209.85.132.250 an-out-0708.google.com Received: from [209.85.132.250] ([209.85.132.250:62545] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/47-61634-388D9894 for ; Wed, 04 Feb 2009 13:03:48 -0500 Received: by an-out-0708.google.com with SMTP id c2so957289anc.38 for ; Wed, 04 Feb 2009 10:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=G0vcsjuBRofH891XoBCtIBbAdNNi9dp3pIl60tzL9r8=; b=xRrh7q4GrbS3M6Nd7qAmRU1yxBYfQ6Dub7TmFdeclLRyuIlr+ibhHVHKvXYFQ1cceV URxz2jv9eIV+kNNxJluaJ6vvuJLZcNer1+R747VRLTq5xNti5j0oib4zE/G9jPKSvhqW Eg4e++8wnKmdvNZf6OoOmE/gpEcKguAxpO1UQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=E5apTlGAqiNIEu1qsU3RfZUPTPXvsOH4CWJeH51Mg7/rEo62M/Qy7bXvmI1WGBFbSP aG4DoZ2R5H36b7Rw5RCiKcRHbeYc5OtHuJb9TGScH72tpOLQ8iOh7sftI1q6ULnmPczS Rnr525lqF91zYjphpO9TO+4KLmq7oRic3YOrQ= MIME-Version: 1.0 Sender: kkooporation@googlemail.com Received: by 10.143.15.11 with SMTP id s11mr3025191wfi.283.1233770624875; Wed, 04 Feb 2009 10:03:44 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Feb 2009 19:03:44 +0100 X-Google-Sender-Auth: df758efb1f1ab011 Message-ID: To: Iain Lewis Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=001636e1fa2cd47e1f04621b9b98 Subject: Re: [PHP-DEV] casting doubles to ints From: kureal@kkooporation.de (Kenan R Sulayman) --001636e1fa2cd47e1f04621b9b98 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Lain! As much as I did understand, this might be a pretty good idea. Anyhow, you want to make this variable to be constant? I think, this might break some calculations.- And another question: Does anyone knows, why PHP is showing 2147483647 as PHP_INT_MAX ? *truly, I'm running x64* Thanks, -- (c) Kenan Sulayman Freelance Designer and Programmer Life's Live Poetry 2009/2/4 Iain Lewis > Hello all, > > I wanted to suggest back porting the behaviour of the DVAL_TO_LVAL macro > from zend_operators.h from 5.3 to 5.2, and wondered whether people thought > this was a good idea or not? > > The reason I want to do this is that while writing some tests, I noticed > that the behaviour of casting a float to an int is a bit counter-intuitive > on 64bit platforms for PHP 5.2. It looks as though this has been fixed in > 5.3, and it would seem like a good idea to put this change back to 5.2 as > well. From a personal point of view, it would mean I could write one test > that would work on both 5.2 and 5.3, but it also seems like a sensible > change, as the current behaviour is non-obvious. The change would cause some > current tests to break, but I am happy to do the work to fix those up. > > This is how a few expressions get evaluated at the moment. Changing the > macro would make the 5.2 behaviour match 5.3 > > Expression 5.3 (RHEL5-64) 5.2 (RHEL5-64) > > (int) (PHP_INT_MAX) 9223372036854775807 9223372036854775807 > (int) (PHP_INT_MAX + 1) 9223372036854775807 -9223372036854775808 > (int) (PHP_INT_MAX + 1000) 9223372036854775807 -9223372036854775808 > (int) (PHP_INT_MAX + 10000) 9223372036854775807 -9223372036854765568 > > Does this seem like a good change? > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001636e1fa2cd47e1f04621b9b98--