Bug #17744 Updated: pow() error

From: Date: Thu, 13 Jun 2002 15:50:51 +0000
Subject: Bug #17744 Updated: pow() error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10357@lists.php.net to get a copy of this message
 ID:               17744
 Updated by:       edink@php.net
 Reported By:      filizzi@umich.edu
-Status:           Open
+Status:           Closed
 Bug Type:         Math related
 Operating System: Linux 2.4.17
 PHP Version:      4.2.1
 New Comment:

This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

As a workaround you can try:

$shipspeed = pow((float)$level_factor, (float)$playerinfo[engines]);



Previous Comments:
------------------------------------------------------------------------

[2002-06-13 11:36:23] filizzi@umich.edu

When using the pow() function as follows, where $level_factor and
$playerinfo[engines] are 1.5, 0 respectivly. (the value for
$playerinfo[engines] can be anywhere from 0 on up and still produce the
same result) and $playerinfo[engines] is taken from a mysql database
(might happen with other database connections as well).

$shipspeed = pow($level_factor, $playerinfo[engines]);

when the line is entered staticly (see below) it works fine.
$shipspeed = pow(1.5, 0);

These are the errors reported.

Warning: Invalid argument(s) passed to pow() in
/usr/local/blacknova/rsmove.php on line 118

Warning: Invalid argument(s) passed to pow() in
/usr/local/blacknova/global_funcs.php on line 421

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=17744&edit=1



Thread (2 messages)

« previous php.bugs (#10357) next »