cvs: php4 /ext/standard/tests/math log.phpt

From: Date: Mon, 11 Nov 2002 03:45:04 +0000
Subject: cvs: php4 /ext/standard/tests/math log.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-15980@lists.php.net to get a copy of this message
jason Sun Nov 10 22:45:04 2002 EDT Added files: /php4/ext/standard/tests/math log.phpt Log: add test function for log() # It is difficult to test an approximation of an approximation, but I # believe this test should be close enough to verify the function is working # correctly. Index: php4/ext/standard/tests/math/log.phpt +++ php4/ext/standard/tests/math/log.phpt --TEST-- log() tests --POST-- --GET-- --FILE-- <?php // $Id: log.phpt,v 1.1 2002/11/11 03:45:04 jason Exp $ echo "On failure, please mail result to php-dev@lists.php.net\n"; for ($x=0, $count=0; $x < 200; $x++) { $x2 = (int) exp(log($x)); // e ^ log(x) should be close in range to x if (($x2 < ($x + 2)) && ($x2 > ($x - 2))) { $count++; } else { print "$x : $x2\n"; } } print $count . "\n"; --EXPECT-- On failure, please mail result to php-dev@lists.php.net 200

« previous php.cvs (#15980) next »