Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78312 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49232 invoked from network); 24 Oct 2014 18:55:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2014 18:55:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.244 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.244 imap1-3.ox.privateemail.com Received: from [198.187.29.244] ([198.187.29.244:33639] helo=imap1-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/59-31309-680AA445 for ; Fri, 24 Oct 2014 14:55:02 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id B29E3B00087; Fri, 24 Oct 2014 14:54:59 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 51_KAqh4DMiD; Fri, 24 Oct 2014 14:54:59 -0400 (EDT) Received: from oa-edu-168-67.wireless.abdn.ac.uk (oa-edu-168-67.wireless.abdn.ac.uk [137.50.168.67]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 20512B0008B; Fri, 24 Oct 2014 14:54:59 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <544A9FFE.8040702@mabe.berlin> Date: Fri, 24 Oct 2014 19:54:55 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <7FBBAAA4-EA7F-42A2-A960-4D14BEB26EC3@ajf.me> References: <66B7B28C-2651-4A71-AC2A-55D4C7BB3DDC@ajf.me> <544959B8.20207@mabe.berlin> <54495C0F.9080404@mabe.berlin> <544A9523.6010104@mabe.berlin> <6D2E5BCF-F26A-4854-AA6D-FA85672FB683@ajf.me> <544A9FFE.8040702@mabe.berlin> To: Marc Bennewitz X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] [RFC] Safe Casting Functions From: ajf@ajf.me (Andrea Faulds) > On 24 Oct 2014, at 19:52, Marc Bennewitz wrote: >> Floats are special, they are not expected to be precise. If we reject = this, then perhaps we should also reject 0.1, because it can=92t be = precisely represented by a float? > It's a difference casting string to float or int to float. > Floats are often used to make sure an argument is a valid number but > this results in data loss incl. on internal functions. You=92re not using the right function, then. -- Andrea Faulds http://ajf.me/