note 85392 added to function.intval

From: Date: Thu, 28 Aug 2008 09:47:22 +0000
Subject: note 85392 added to function.intval
Groups: php.notes 
Request: Send a blank email to php-notes+get-143911@lists.php.net to get a copy of this message
Re: nobodyisperfect88 at hotmail dot de jay at w3prodigy dot com had it right. I believe it is an issue with the floating point registers on computers, which have a precision of about 17 digits. When you get more precise than that, it rounds. Since the second example can fit in the register, no rounding occurs, and PHP can truncate the portion after the decimal. However, the system automatically rounds the first example to 1, which is what PHP returns. (Tested on Windows XP 32bit) ---- Server IP: 209.41.74.194 Probable Submitter: 68.123.26.166 ---- Manual Page -- http://www.php.net/manual/en/function.intval.php Edit -- https://master.php.net/note/edit/85392 Del: integrated -- https://master.php.net/note/delete/85392/integrated Del: useless -- https://master.php.net/note/delete/85392/useless Del: bad code -- https://master.php.net/note/delete/85392/bad+code Del: spam -- https://master.php.net/note/delete/85392/spam Del: non-english -- https://master.php.net/note/delete/85392/non-english Del: in docs -- https://master.php.net/note/delete/85392/in+docs Del: other reasons-- https://master.php.net/note/delete/85392 Reject -- https://master.php.net/note/reject/85392 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143911) next »