Bug #69129 [Opn->Nab]: Floor, doesn't work at it shuld.

From: Date: Thu, 26 Feb 2015 21:53:38 +0000
Subject: Bug #69129 [Opn->Nab]: Floor, doesn't work at it shuld.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190970@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69129&edit=1 ID: 69129 Updated by: aharvey@php.net Reported by: potarhere at gmail dot com Summary: Floor, doesn't work at it shuld. -Status: Open +Status: Not a bug Type: Bug Package: Filter related Operating System: Debian 7.0 PHP Version: 5.4.38 Block user comment: N Private report: N New Comment: Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about "floats" and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2015-02-26 21:48:40] potarhere at gmail dot com Description: ------------ I have found a small bug while using floor function. The function isn't showing as I wanted (and the function were made for). Cheers, Potar Test script: --------------- echo floor(2.9999999999999999); // 3 echo floor(2.999999999999999); // 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69129&edit=1

« previous php.bugs (#190970) next »