php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14796 error in calculating with minus
Submitted: 2002-01-02 07:20 UTC Modified: 2002-01-02 10:13 UTC
From: olimac at sixworx dot de Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.1.0 OS: suse linux 7.1
Private report: No CVE-ID: None
 [2002-01-02 07:20 UTC] olimac at sixworx dot de
php allways returns after echo 166.3 - 166.6;

-0.29999999999998

but the right result is -0.3

is there a fix for this problem?

thanx

-OLIMAC

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-02 07:30 UTC] bate@php.net
Its tested with 4.1.1

I tested with 
128.1 - 128.0

I think this error just occours if the result >1.0 and the numbers >=128.0.


 [2002-01-02 07:38 UTC] jimw@php.net
floating point numbers are not exact. see http://www.php.net/manual/en/language.types.float.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC