php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33168 Incorrect abs() result.
Submitted: 2005-05-28 01:15 UTC Modified: 2005-05-28 07:15 UTC
From: dima at snaiper dot no-ip dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.0.4 OS: windows xp
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: dima at snaiper dot no-ip dot com
New email:
PHP Version: OS:

 

 [2005-05-28 01:15 UTC] dima at snaiper dot no-ip dot com
Description:
------------
I get rounded value in abs() function.

Reproduce code:
---------------
echo abs(-10.414234005636601);
echo "<br>";
echo abs(-340.1242340053423432423000000000000234324636601);
echo "<br>";
echo abs(-1320.72423000340056366201);
	

Expected result:
----------------
10.414234005636601
340.1242340053423432423000000000000234324636601
1320.72423000340056366201

Actual result:
--------------
10.4142340056
340.124234005
1320.72423

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-28 07:15 UTC] rasmus@php.net
If you want higher precision from the math functions in PHP, then you need to configure that in your ini file via the precision directive.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC