note 87636 added to gmp.examples

From: Date: Sat, 13 Dec 2008 17:25:00 +0000
Subject: note 87636 added to gmp.examples
Groups: php.notes 
Request: Send a blank email to php-notes+get-148127@lists.php.net to get a copy of this message
I believe that "fact" computes the factorial of $x-1 not of $x. The for statement should be for ($i=2; $i <= $x; $i++) not for ($i=2; $i < $x; $i++) If you try to compute the factorial of 2 for example, the for loop will not be executed and the result will be 1. ---- Server IP: 69.147.83.197 Probable Submitter: 76.246.16.69 ---- Manual Page -- http://www.php.net/manual/en/gmp.examples.php Edit -- https://master.php.net/note/edit/87636 Del: integrated -- https://master.php.net/note/delete/87636/integrated Del: useless -- https://master.php.net/note/delete/87636/useless Del: bad code -- https://master.php.net/note/delete/87636/bad+code Del: spam -- https://master.php.net/note/delete/87636/spam Del: non-english -- https://master.php.net/note/delete/87636/non-english Del: in docs -- https://master.php.net/note/delete/87636/in+docs Del: other reasons-- https://master.php.net/note/delete/87636 Reject -- https://master.php.net/note/reject/87636 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#148127) next »