#45442 [Opn->Bgs]: Math problem

From: Date: Mon, 07 Jul 2008 08:25:26 +0000
Subject: #45442 [Opn->Bgs]: Math problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126333@lists.php.net to get a copy of this message
ID: 45442 Updated by: pajoye@php.net Reported By: s dot kozlov at promoting dot ru -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Fedora 6 PHP Version: 5.2.6 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://docs.sun.com/source/806-3568/ncg_goldberg.html Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2008-07-07 07:44:23] s dot kozlov at promoting dot ru Description: ------------ Math bug Reproduce code: --------------- echo floor(1710 / (1710 / 100)); Expected result: ---------------- 100 Actual result: -------------- 99 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45442&edit=1

« previous php.bugs (#126333) next »