Doc #66288 [Nab]: pow() gives unexpected results if exponent is negative

From: Date: Fri, 13 Dec 2013 22:15:00 +0000
Subject: Doc #66288 [Nab]: pow() gives unexpected results if exponent is negative
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10709@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66288&edit=1 ID: 66288 Updated by: rasmus@php.net Reported by: mattT1227 at gmail dot com Summary: pow() gives unexpected results if exponent is negative Status: Not a bug Type: Documentation Problem Package: *General Issues PHP Version: 5.5.7 Block user comment: N Private report: N New Comment: By the way, where is the suspended bug on this? We should mark that as Not-a-bug as well. 4^-2 is the same as 1/(4^2) which is most definitely not the same as the square root of 4. Where in the world did you get that from? Previous Comments: ------------------------------------------------------------------------ [2013-12-13 18:24:51] aharvey@php.net pow() handles negative exponents fine: pow(4, -2) is 0.0625, which seems correct to me and also to Wolfram|Alpha: http://www.wolframalpha.com/input/?i=4^-2 Closing not a bug. ------------------------------------------------------------------------ [2013-12-13 16:11:35] mattT1227 at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.pow --- At least show example that negative exponents are not correctly implemented by pow. Note, reporting system shows this problem has been suspended. It is still a problem. Test script: --------------- echo pow(4, -2); // should be same as square root of 4 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66288&edit=1

« previous php.doc.bugs (#10709) next »