Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33212 invoked from network); 29 Aug 2016 14:09:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Aug 2016 14:09:06 -0000 Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.154 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.154 v-smtpout1.han.skanova.net Received: from [81.236.60.154] ([81.236.60.154:41741] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/E9-34481-9F144C75 for ; Mon, 29 Aug 2016 10:09:03 -0400 Received: from [192.168.8.8] ([94.254.95.82]) by cmsmtp with SMTP id eNF8bjoaQCjZEeNF8bBktS; Mon, 29 Aug 2016 16:08:54 +0200 To: David Rodrigues References: Cc: Andrea Faulds , PHP internals Message-ID: Date: Mon, 29 Aug 2016 16:09:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfEeUU85tps3m6rqO2B+/EGWzd4VmiZKhc9JxbVsZKWHWMIZL4EWXd1Xl6zG9Du9tii6EFcBhfPfFhYzUXvJsdlLmYOxDKTL7xL3A9sZRFnM/Wsfp+/gv WuupQp0oSUQ64gWihYhOrhlVm5eT7boHJ/a85UbN4cRhQsY7kjuL7giLpuEmHgC67JBkATIDN3wghTPbOvlXfV7yl6i8xGQ3vygQYCuXdM/so87Y0eyNnAz0 Subject: Re: [PHP-DEV] Allow infinity integer length From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) There was / is a proposal about bigints, see: https://wiki.php.net/rfc/bigint Regards //Björn Larsson Den 2016-08-29 kl. 15:48, skrev David Rodrigues: > Currently PHP integer is limited to 2147483647 or 9223372036854775807 > (PHP_INT_MAX), depending of system bits. We can works with long > integers by using bcmath, for instance. But why not to support it > natively? > > I mean, PHP can parse infinity integers, but it's converted to > cientific notation or to INF. > > My suggestion is that, instead of convert it, stores the value in > another format, an int[] or string, expanding depending of parsed > length. > > Then accept things like: > > 10000000000000000000000000000000 + 10000000000000000000000000000000 = > 20000000000000000000000000000000 > > Yeah, I know that it should be slower than normal ints, but is an > exceptional case. It should avoid problems caused by untested code > with very large numbers, for instance. > > Same for float values, but in this case I think that should have a > best implementation to defines length of mantissa, for instance (new > Float($float, $bits), for instance). But it can be part of another > discussion. >