Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21720 invoked from network); 8 Dec 2016 21:23:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2016 21:23:14 -0000 X-Host-Fingerprint: 94.13.90.90 unknown Received: from [94.13.90.90] ([94.13.90.90:20559] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/37-12501-04FC9485 for ; Thu, 08 Dec 2016 16:23:14 -0500 Message-ID: To: internals@lists.php.net References: Date: Thu, 8 Dec 2016 21:23:08 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 94.13.90.90 Subject: Re: [PHP-DEV] PDO::PARAM_DOUBLE From: ajf@ajf.me (Andrea Faulds) Hi, Matteo Beccati wrote: > Hi Adam, > > On 07/12/2016 23:37, Adam Baratz wrote: >> For decimal, double wouldn't be the correct type anyway, as it could >> cause loss of precision. >> >> >> Sure, agree the name is imprecise. "Double" is mainly relevant to zvals. > > It's not about naming. Double is relevant both to PHP and SQL and is a > floating point type. On the other hand, decimal/numeric fields should be > represented as strings as they are fixed point/precision, which is > something we don't have in stock php. In fact bcmath uses strings too. On the subject of naming, if we were to add this, I would think the name should be PDO::PARAM_FLOAT instead, as that's the more common name for the PHP float type now. It's IS_DOUBLE internally, but that is mostly an implementation detail, like IS_LONG. Thanks. -- Andrea Faulds https://ajf.me/