Bug #80867 [Opn->Nab]: bccomp warning for INF
| From: | nikic@php.net | Date: | Mon, 15 Mar 2021 09:39:34 +0000 |
| Subject: | Bug #80867 [Opn->Nab]: bccomp warning for INF | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232724@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80867&edit=1
ID: 80867
Updated by: nikic@php.net
Reported by: marian dot sedivy at gmail dot com
Summary: bccomp warning for INF
-Status: Open
+Status: Not a bug
Type: Bug
Package: *Math Functions
Operating System: MacOS
PHP Version: 7.4.16
Block user comment: N
Private report: N
New Comment:
bcmath does *not* work with floating-pointing point numbers. It works with fixed-point numbers
represented as strings. It does not have a concept of "INF".
Previous Comments:
------------------------------------------------------------------------
[2021-03-15 09:37:12] marian dot sedivy at gmail dot com
Description:
------------
---
From manual page: https://php.net/function.bccomp
---
This code: var_dump(bccomp(-INF, 1.0, 2)); produces error
PHP Warning: bccomp(): bcmath function argument is not well-formed
But according to docs (https://www.php.net/manual/en/math.constants.php) INF is float, so I think,
that this Warning is wrong.
Test script:
---------------
var_dump(bccomp(-INF, 1.0, 2));
Expected result:
----------------
No warning
Actual result:
--------------
PHP Warning: bccomp(): bcmath function argument is not well-formed
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80867&edit=1