cvs: php4(PHP_4_0_7) /ext/standard/tests/math 001.phpt abs.phpt pow.phpt round.phpt

From: Date: Mon, 22 Oct 2001 09:46:23 +0000
Subject: cvs: php4(PHP_4_0_7) /ext/standard/tests/math 001.phpt abs.phpt pow.phpt round.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7912@lists.php.net to get a copy of this message
jeroen Mon Oct 22 05:46:23 2001 EDT Added files: (Branch: PHP_4_0_7) /php4/ext/standard/tests/math abs.phpt round.phpt Removed files: /php4/ext/standard/tests/math 001.phpt Modified files: /php4/ext/standard/tests/math pow.phpt Log: MFH (math tests pass now - at least on my system) Index: php4/ext/standard/tests/math/pow.phpt diff -u php4/ext/standard/tests/math/pow.phpt:1.3 php4/ext/standard/tests/math/pow.phpt:1.3.2.1 --- php4/ext/standard/tests/math/pow.phpt:1.3 Sun Aug 5 14:38:48 2001 +++ php4/ext/standard/tests/math/pow.phpt Mon Oct 22 05:46:23 2001 @@ -3,7 +3,8 @@ --POST-- --GET-- --FILE-- -<?php +<?php // $Id: pow.phpt,v 1.3.2.1 2001/10/22 09:46:23 jeroen Exp $ + define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), @@ -126,7 +127,7 @@ (LONG_MAX-1)*(LONG_MAX-1) === pow(LONG_MAX-1,2.0) FALSE ===@pow(LONG_MIN+1,2.0) LONG_MAX === pow(LONG_MAX,1) -LONG_MIN === pow(LONG_MIN,1) +LONG_MIN ~== pow(LONG_MIN,1) LONG_MAX*LONG_MAX === pow(LONG_MAX,2) LONG_MIN*LONG_MIN === pow(LONG_MIN,2) (float)LONG_MAX === pow(LONG_MAX,1.0) Index: php4/ext/standard/tests/math/abs.phpt +++ php4/ext/standard/tests/math/abs.phpt --TEST-- Simple math tests --POST-- --GET-- --FILE-- <?php // $Id: abs.phpt,v 1.1 2001/10/22 09:44:27 jeroen Exp $ define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS 1 === abs(-1) 1.5 === abs(-1.5) 1 === abs("-1") 1.5 === abs("-1.5") -LONG_MIN+1 === abs(LONG_MIN-1) -LONG_MIN === abs(LONG_MIN) -(LONG_MIN+1) === abs(LONG_MIN+1) TESTS; include('../../../../tests/quicktester.inc'); --EXPECT-- 1,1,0,0 OK Index: php4/ext/standard/tests/math/round.phpt +++ php4/ext/standard/tests/math/round.phpt --TEST-- Simple math tests --POST-- --GET-- --FILE-- <?php // $Id: round.phpt,v 1.1 2001/10/22 09:44:27 jeroen Exp $ define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS -1 ~== ceil(-1.5) 2 ~== ceil( 1.5) -2 ~== floor(-1.5) 1 ~== floor(1.5) LONG_MIN ~== ceil(LONG_MIN - 0.5) LONG_MIN+1 ~== ceil(LONG_MIN + 0.5) LONG_MIN-1 ~== round(LONG_MIN - 0.6) LONG_MIN ~== round(LONG_MIN - 0.4) LONG_MIN ~== round(LONG_MIN + 0.4) LONG_MIN+1 ~== round(LONG_MIN + 0.6) LONG_MIN-1 ~== floor(LONG_MIN - 0.5) LONG_MIN ~== floor(LONG_MIN + 0.5) LONG_MAX ~== ceil(LONG_MAX - 0.5) LONG_MAX+1 ~== ceil(LONG_MAX + 0.5) LONG_MAX-1 ~== round(LONG_MAX - 0.6) LONG_MAX ~== round(LONG_MAX - 0.4) LONG_MAX ~== round(LONG_MAX + 0.4) LONG_MAX+1 ~== round(LONG_MAX + 0.6) LONG_MAX-1 ~== floor(LONG_MAX - 0.5) LONG_MAX ~== floor(LONG_MAX + 0.5) TESTS; include('../../../../tests/quicktester.inc'); --EXPECT-- 1,1,0,0 OK

« previous php.cvs (#7912) next »