php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46376 var_dump(0.09 + 0.01); // float(0.0:)
Submitted: 2008-10-24 10:29 UTC Modified: 2008-10-24 10:31 UTC
From: s6urik at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.6 OS: Linux (Amazon EC2)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: s6urik at gmail dot com
New email:
PHP Version: OS:

 

 [2008-10-24 10:29 UTC] s6urik at gmail dot com
Description:
------------
Result of expression "0.01 + 0.09" is "float(0.0:)", yes, zero dot zero colon. Though "0.1 * 0.1 + 0.9" returns "float(0.1)" as it should, so internally float looks to be stored correctly.

This bug appears only in Amazon EC2 virtual hosting environment:
  Instance Type: Small Instance
  Kernel: Linux 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 GNU/Linux
  Tested PHP versions: 5.2.4, 5.2.6

PHP 5.3.0alpha3-dev is not affected.

Reproduce code:
---------------
var_dump(0.01 + 0.09)

Expected result:
----------------
float(0.1)

Actual result:
--------------
float(0.0:)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-24 10:31 UTC] jani@php.net
Works fine in sane environment using latest CVS snapshot of PHP_5_2, PHP_5_3 and HEAD.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 15:00:01 2025 UTC