php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42487 php.ini setting for "precision" ignored. value is always 6
Submitted: 2007-08-30 13:17 UTC Modified: 2007-08-30 13:19 UTC
From: gerhard dot mueller at travian dot org Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.2.3 OS: Linux Debian
Private report: No CVE-ID: None
 [2007-08-30 13:17 UTC] gerhard dot mueller at travian dot org
Description:
------------
The php.ini setting of "precision" seems to be ignored and is always 6. I makes no difference when you override it with ini_set() or directly in php.ini.

tested on 5.1.6, 5.2.2 and 5.2.3 on several Linux Servers and 2 Windows PCs. Only in 5.1.6 change of "precision" was not ignored.

Example in php.ini
; The number of significant digits displayed in floating point numbers.
precision    =  12

Same as this report but bug has nothing to do with round()
http://bugs.php.net/bug.php?id=42484

Reproduce code:
---------------
ini_set('precision','6');
$big_int = (float)1200000;
print "precision6: $big_int \n\n";

ini_set('precision','12');
$big_int = (float)1200000;
print "precision12: $big_int";



Expected result:
----------------
precision6: 1.2E+006

precision12: 1200000

Actual result:
--------------
precision6: 1.2E+006

precision12: 1.2E+006

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-30 13:19 UTC] jani@php.net
Precision has nothing to do with this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 00:01:30 2024 UTC