php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20440 wrong output for simple calculation
Submitted: 2002-11-15 02:18 UTC Modified: 2002-11-15 02:20 UTC
From: wico at cnh dot nl Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.3 OS: linux
Private report: No CVE-ID: None
 [2002-11-15 02:18 UTC] wico at cnh dot nl
Try:
<?
  die(209 - 208.17);
?>

outputs: 
 0.83000000000001
should be just:
 0.83

Gr,

Wico

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-15 02:20 UTC] derick@php.net
Read the part about Floating Point precision in our manual:

http://www.php.net/manual/en/printwn/language.types.float.php

Derick
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 06:01:32 2025 UTC