Req #76578 [Opn->Wfx]: ** operator and negative base
| From: | requinix@php.net | Date: | Wed, 04 Jul 2018 12:17:58 +0000 |
| Subject: | Req #76578 [Opn->Wfx]: ** operator and negative base | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216134@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76578&edit=1
ID: 76578
Updated by: requinix@php.net
Reported by: amenshchikov at gmail dot com
Summary: ** operator and negative base
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: PHP Language Specification
+Package: *General Issues
Operating System: Debian 9
PHP Version: 7.2.7
Block user comment: N
Private report: N
New Comment:
** having higher precedence than - was specifically discussed when the operator was being added.
http://php.net/manual/en/language.operators.precedence.php
https://wiki.php.net/rfc/pow-operator
Previous Comments:
------------------------------------------------------------------------
[2018-07-04 12:13:07] amenshchikov at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.operators.arithmetic
---
When I try to raise number -9 to the power of 0.5 (take a root of even degree), I have -3 as result.
But I think that NaN should be a more correct in this case.
Test script:
---------------
echo -9**0.5;
Expected result:
----------------
NAN
Actual result:
--------------
-3
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76578&edit=1