#47107 [Opn->Bgs]: numbers with more than 15 digits are not behaved normally

From: Date: Thu, 15 Jan 2009 12:48:30 +0000
Subject: #47107 [Opn->Bgs]: numbers with more than 15 digits are not behaved normally
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132894@lists.php.net to get a copy of this message
ID: 47107 Updated by: jani@php.net Reported By: mucahitkahveci at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows xp sp2 PHP Version: 5.2.8 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. And 32bit issue..etc. etc. No bug. Previous Comments: ------------------------------------------------------------------------ [2009-01-14 19:57:52] mucahitkahveci at gmail dot com Description: ------------ printf('%f', 55555555555555555555); prints 55555555555555557376.000000 This number (555...) has 20 digits this happen in any number with more than 15 digits Reproduce code: --------------- printf('%f', 55555555555555555555); Expected result: ---------------- 55555555555555555555.000000 Actual result: -------------- 55555555555555557376.000000 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47107&edit=1

« previous php.bugs (#132894) next »