note 34193 added to function.pow

From: Date: Fri, 18 Jul 2003 01:01:30 +0000
Subject: note 34193 added to function.pow
Groups: php.notes 
Request: Send a blank email to php-notes+get-52307@lists.php.net to get a copy of this message
A couple of points on pow(): 1. One of the official examples of pow(2,8) is not pragmatic; use 1 << 8 as it's substantially faster 2. When passing variables to pow(), cast them otherwise you might get warnings on some versions of PHP 3. All the rules of algebra apply: b**(-e) is 1/(b**e), b**(p/q) is the qth root of b**p So, e.g., sqrt($x) === pow($x, .5); but sqrt() is faster. ---- Manual Page -- http://www.php.net/manual/en/function.pow.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34193 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34193&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34193&report=yes

« previous php.notes (#52307) next »