diff options
Diffstat (limited to 'ext/standard/tests/math')
-rw-r--r-- | ext/standard/tests/math/abs.phpt | 24 | ||||
-rw-r--r-- | ext/standard/tests/math/bug21523.phpt | 12 | ||||
-rw-r--r-- | ext/standard/tests/math/bug24142.phpt | 20 | ||||
-rw-r--r-- | ext/standard/tests/math/bug25665.phpt | 16 | ||||
-rw-r--r-- | ext/standard/tests/math/bug25694.phpt | 35 | ||||
-rwxr-xr-x | ext/standard/tests/math/bug27646.phpt | 48 | ||||
-rwxr-xr-x | ext/standard/tests/math/bug28228.phpt | 14 | ||||
-rwxr-xr-x | ext/standard/tests/math/bug30069.phpt | 12 | ||||
-rw-r--r-- | ext/standard/tests/math/bug30695.phpt | 54 | ||||
-rw-r--r-- | ext/standard/tests/math/constants.phpt | 46 | ||||
-rw-r--r-- | ext/standard/tests/math/floorceil.phpt | 44 | ||||
-rw-r--r-- | ext/standard/tests/math/hexdec.phpt | 22 | ||||
-rw-r--r-- | ext/standard/tests/math/log.phpt | 42 | ||||
-rw-r--r-- | ext/standard/tests/math/pow.phpt | 149 | ||||
-rw-r--r-- | ext/standard/tests/math/round.phpt | 37 |
15 files changed, 0 insertions, 575 deletions
diff --git a/ext/standard/tests/math/abs.phpt b/ext/standard/tests/math/abs.phpt deleted file mode 100644 index f5c26c3037..0000000000 --- a/ext/standard/tests/math/abs.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Simple math tests ---FILE-- -<?php // $Id$ - -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(dirname(__FILE__) . '/../../../../tests/quicktester.inc'); ---EXPECT-- -1,1,0,0 -OK diff --git a/ext/standard/tests/math/bug21523.phpt b/ext/standard/tests/math/bug21523.phpt deleted file mode 100644 index 9fc441fba4..0000000000 --- a/ext/standard/tests/math/bug21523.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #21523 (number_format tries to allocate negative amount of memory) ---FILE-- -<?php // $Id$ vim600:syn=php -set_time_limit(5); - -var_dump(number_format(-2000, 2768)); -echo "OK"; -?> ---EXPECT-- -string(2775) "-2,000.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -OK diff --git a/ext/standard/tests/math/bug24142.phpt b/ext/standard/tests/math/bug24142.phpt deleted file mode 100644 index 244952369d..0000000000 --- a/ext/standard/tests/math/bug24142.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #24142 (round() problems) ---FILE-- -<?php // $Id$ vim600:syn=php -$v = 0.005; -for ($i = 1; $i < 10; $i++) { - echo "round({$v}, 2) -> ".round($v, 2)."\n"; - $v += 0.01; -} -?> ---EXPECT-- -round(0.005, 2) -> 0.01 -round(0.015, 2) -> 0.02 -round(0.025, 2) -> 0.03 -round(0.035, 2) -> 0.04 -round(0.045, 2) -> 0.05 -round(0.055, 2) -> 0.06 -round(0.065, 2) -> 0.07 -round(0.075, 2) -> 0.08 -round(0.085, 2) -> 0.09 diff --git a/ext/standard/tests/math/bug25665.phpt b/ext/standard/tests/math/bug25665.phpt deleted file mode 100644 index 469236c943..0000000000 --- a/ext/standard/tests/math/bug25665.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #25665 (var_dump () hangs on Nan and INF) ---SKIPIF-- -<?php - $OS = strtoupper(PHP_OS); - if ($OS == 'SUNOS' || $OS == 'SOLARIS') die("SKIP Solaris acos() returns wrong value"); -?> ---FILE-- -<?php -set_time_limit(5); -var_dump(acos(1.01)); -var_dump(log(0)); -?> ---EXPECT-- -float(NAN) -float(-INF) diff --git a/ext/standard/tests/math/bug25694.phpt b/ext/standard/tests/math/bug25694.phpt deleted file mode 100644 index 165e1db083..0000000000 --- a/ext/standard/tests/math/bug25694.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #25694 (round() and number_format() inconsistency) ---FILE-- -<?php -echo "round 0.045 = " . round(0.045, 2) . "\n"; -echo "number format 0.045 = " . number_format(0.045, 2) . "\n\n"; -echo "round 0.055 = " . round(0.055, 2) . "\n"; -echo "number format 0.055 = " . number_format(0.055, 2) . "\n\n"; -echo "round 5.045 = " . round(5.045, 2) . "\n"; -echo "number format 5.045 = " . number_format(5.045, 2) . "\n\n"; -echo "round 5.055 = " . round(5.055, 2) . "\n"; -echo "number format 5.055 = " . number_format(5.055, 2) . "\n\n"; -echo "round 3.025 = " . round(3.025, 2) . "\n"; -echo "number format 3.025 = " . number_format(3.025, 2) . "\n\n"; -echo "round 4.025 = " . round(4.025, 2) . "\n"; -echo "number format 4.025 = " . number_format(4.025, 2) . "\n\n"; -?> ---EXPECT-- -round 0.045 = 0.05 -number format 0.045 = 0.05 - -round 0.055 = 0.06 -number format 0.055 = 0.06 - -round 5.045 = 5.05 -number format 5.045 = 5.05 - -round 5.055 = 5.06 -number format 5.055 = 5.06 - -round 3.025 = 3.03 -number format 3.025 = 3.03 - -round 4.025 = 4.03 -number format 4.025 = 4.03 diff --git a/ext/standard/tests/math/bug27646.phpt b/ext/standard/tests/math/bug27646.phpt deleted file mode 100755 index 7b4a923f1f..0000000000 --- a/ext/standard/tests/math/bug27646.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #27646 (Cannot serialize/unserialize non-finite numeric values) ---FILE-- -<?php -set_time_limit(5); - -$f=12.3; -var_dump($f); -var_dump(serialize($f)); -var_dump(unserialize(serialize($f))); - -$f=-12.3; -var_dump($f); -var_dump(serialize($f)); -var_dump(unserialize(serialize($f))); - -$f=-INF; -var_dump($f); -var_dump(serialize($f)); -var_dump(unserialize(serialize($f))); - -$f=INF; -var_dump($f); -var_dump(serialize($f)); -var_dump(unserialize(serialize($f))); - -$f=NAN; -var_dump($f); -var_dump(serialize($f)); -var_dump(unserialize(serialize($f))); - -?> ---EXPECTF-- -float(1%f) -string(%d) "d:1%s;" -float(1%f) -float(-1%f) -string(%d) "d:-1%s;" -float(-1%f) -float(-INF) -string(7) "d:-INF;" -float(-INF) -float(INF) -string(6) "d:INF;" -float(INF) -float(NAN) -string(6) "d:NAN;" -float(NAN) diff --git a/ext/standard/tests/math/bug28228.phpt b/ext/standard/tests/math/bug28228.phpt deleted file mode 100755 index 4223f4bc15..0000000000 --- a/ext/standard/tests/math/bug28228.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #28228 (number_format() does not allow empty decimal separator) ---FILE-- -<?php -echo number_format(1234.5678, 4, '', '') . "\n"; -echo number_format(1234.5678, 4, NULL, ',') . "\n"; -echo number_format(1234.5678, 4, 0, ',') . "\n"; -echo number_format(1234.5678, 4); -?> ---EXPECT-- -12345678 -1,234.5678 -1,23405678 -1,234.5678 diff --git a/ext/standard/tests/math/bug30069.phpt b/ext/standard/tests/math/bug30069.phpt deleted file mode 100755 index 5e3246c51c..0000000000 --- a/ext/standard/tests/math/bug30069.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #30069 (floats as strings used in calculations do not work) ---FILE-- -<?php -echo ".1" * "2"; -echo "\n"; -echo "-.1" * "2"; -echo "\n"; -?> ---EXPECT-- -0.2 --0.2 diff --git a/ext/standard/tests/math/bug30695.phpt b/ext/standard/tests/math/bug30695.phpt deleted file mode 100644 index c515784ee2..0000000000 --- a/ext/standard/tests/math/bug30695.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Bug #30695 (32 bit issues) ---FILE-- -<?php - function toUTF8( $char_code ) - { - switch ( $char_code ) - { - case 0: - $char = chr( 0 ); - case !($char_code & 0xffffff80): // 7 bit - $char = chr( $char_code ); - break; - case !($char_code & 0xfffff800): // 11 bit - $char = ( chr(0xc0 | (($char_code >> 6) & 0x1f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xffff0000): // 16 bit - $char = ( chr(0xe0 | (($char_code >> 12) & 0x0f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xffe00000): // 21 bit - $char = ( chr(0xf0 | (($char_code >> 18) & 0x07)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - break; - case !($char_code & 0xfc000000): // 26 bit - $char = ( chr(0xf8 | (($char_code >> 24) & 0x03)) . - chr(0x80 | (($char_code >> 18) & 0x3f)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - default: // 31 bit - $char = ( chr(0xfc | (($char_code >> 30) & 0x01)) . - chr(0x80 | (($char_code >> 24) & 0x3f)) . - chr(0x80 | (($char_code >> 18) & 0x3f)) . - chr(0x80 | (($char_code >> 12) & 0x3f)) . - chr(0x80 | (($char_code >> 6) & 0x3f)) . - chr(0x80 | ($char_code & 0x3f)) ); - } - return $char; - } - - - echo "\n", toUTF8(65), "\n", toUTF8(233), "\n", toUTF8(1252), "\n", toUTF8(20095), "\n"; -?> ---EXPECT-- - -A -é -Ӥ -乿 diff --git a/ext/standard/tests/math/constants.phpt b/ext/standard/tests/math/constants.phpt deleted file mode 100644 index 7b5110f532..0000000000 --- a/ext/standard/tests/math/constants.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Math constants ---FILE-- -<?php -$constants = array( - "M_E", - "M_LOG2E", - "M_LOG10E", - "M_LN2", - "M_LN10", - "M_PI", - "M_PI_2", - "M_PI_4", - "M_1_PI", - "M_2_PI", - "M_SQRTPI", - "M_2_SQRTPI", - "M_LNPI", - "M_EULER", - "M_SQRT2", - "M_SQRT1_2", - "M_SQRT3" -); -foreach($constants as $constant) { - printf("%-10s: %s\n", $constant, constant($constant)); -} -?> ---EXPECTREGEX-- -M_E : 2.718281[0-9]* -M_LOG2E : 1.442695[0-9]* -M_LOG10E : 0.434294[0-9]* -M_LN2 : 0.693147[0-9]* -M_LN10 : 2.302585[0-9]* -M_PI : 3.141592[0-9]* -M_PI_2 : 1.570796[0-9]* -M_PI_4 : 0.785398[0-9]* -M_1_PI : 0.318309[0-9]* -M_2_PI : 0.636619[0-9]* -M_SQRTPI : 1.772453[0-9]* -M_2_SQRTPI: 1.128379[0-9]* -M_LNPI : 1.144729[0-9]* -M_EULER : 0.577215[0-9]* -M_SQRT2 : 1.414213[0-9]* -M_SQRT1_2 : 0.707106[0-9]* -M_SQRT3 : 1.732050[0-9]* - diff --git a/ext/standard/tests/math/floorceil.phpt b/ext/standard/tests/math/floorceil.phpt deleted file mode 100644 index 2f7d82c6e6..0000000000 --- a/ext/standard/tests/math/floorceil.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Tests for floor en ceil ---FILE-- -<?php - $a = ceil (-0); $b = ceil (-1); $c = ceil (-1.5); - $d = ceil (-1.8); $e = ceil (-2.7); - var_dump ($a, $b, $c, $d, $e); - - $a = ceil (0); $b = ceil (0.5); $c = ceil (1); - $d = ceil (1.5); $e = ceil (1.8); $f = ceil (2.7); - var_dump ($a, $b, $c, $d, $e, $f); - - $a = floor (-0); $b = floor (-0.5); $c = floor (-1); - $d = floor (-1.5); $e = floor (-1.8); $f = floor (-2.7); - var_dump ($a, $b, $c, $d, $e, $f); - - $a = floor (0); $b = floor (0.5); $c = floor (1); - $d = floor (1.5); $e = floor (1.8); $f = floor (2.7); - var_dump ($a, $b, $c, $d, $e, $f); -?> ---EXPECT-- -float(0) -float(-1) -float(-1) -float(-1) -float(-2) -float(0) -float(1) -float(1) -float(2) -float(2) -float(3) -float(0) -float(-1) -float(-1) -float(-2) -float(-2) -float(-3) -float(0) -float(0) -float(1) -float(1) -float(1) -float(2) diff --git a/ext/standard/tests/math/hexdec.phpt b/ext/standard/tests/math/hexdec.phpt deleted file mode 100644 index d8ff71f1ce..0000000000 --- a/ext/standard/tests/math/hexdec.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -overflow check for _php_math_basetozval ---FILE-- -<?php - -var_dump(hexdec("012345")); -var_dump(hexdec("12345")); -var_dump(hexdec("q12345")); -var_dump(hexdec("12345+?!")); -var_dump(hexdec("12345q")); -var_dump((float)hexdec("1234500001")); -var_dump((float)hexdec("17fffffff")); - -?> ---EXPECT-- -int(74565) -int(74565) -int(74565) -int(74565) -int(74565) -float(78187069441) -float(6442450943) diff --git a/ext/standard/tests/math/log.phpt b/ext/standard/tests/math/log.phpt deleted file mode 100644 index 4f8b47a76b..0000000000 --- a/ext/standard/tests/math/log.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -log() tests ---FILE-- -<?php // $Id$ -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"; - -// Now test the base form of log -for ($base = 2; $base < 11; $base++) { - for ($x = 0, $count= 0; $x < 50; $x++) { - $x2 = (int) pow($base, log($x, $base)); - // base ^ log(x) should be close in range to x - if (($x2 < ($x + 2)) && ($x2 > ($x - 2))) { - $count++; - } else { - print "base $base: $x : $x2\n"; - } - } - print $count . "\n"; -} -?> ---EXPECT-- -On failure, please mail result to php-dev@lists.php.net -200 -50 -50 -50 -50 -50 -50 -50 -50 -50 diff --git a/ext/standard/tests/math/pow.phpt b/ext/standard/tests/math/pow.phpt deleted file mode 100644 index a1e8944830..0000000000 --- a/ext/standard/tests/math/pow.phpt +++ /dev/null @@ -1,149 +0,0 @@ ---TEST-- -Various pow() tests ---FILE-- -<?php // $Id$ - -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 - 0.25 === pow(-2,-2) --0.5 === pow(-2,-1) - 1 === pow(-2, 0) --2 === pow(-2, 1) - 4 === pow(-2, 2) - 1.0 === pow(-1,-2) --1.0 === pow(-1,-1) - 1 === pow(-1, 0) --1 === pow(-1, 1) - 1 === pow(-1, 2) - TRUE === is_infinite(pow(0,-2)) - TRUE === is_infinite(pow(0,-1)) - 1 === pow( 0, 0) - 0 === pow( 0, 1) - 0 === pow( 0, 2) - 1.0 === pow( 1,-2) - 1.0 === pow( 1,-1) - 1 === pow( 1, 0) - 1 === pow( 1, 1) - 1 === pow( 1, 2) - 0.25 === pow( 2,-2) - 0.5 === pow( 2,-1) - 1 === pow( 2, 0) - 2 === pow( 2, 1) - 4 === pow( 2, 2) - 0.25 === pow(-2,-2.0) --0.5 === pow(-2,-1.0) - 1.0 === pow(-2, 0.0) --2.0 === pow(-2, 1.0) - 4.0 === pow(-2, 2.0) - 1.0 === pow(-1,-2.0) --1.0 === pow(-1,-1.0) - 1.0 === pow(-1, 0.0) --1.0 === pow(-1, 1.0) - 1.0 === pow(-1, 2.0) - TRUE === is_infinite(pow(0,-2.0)) - TRUE === is_infinite(pow(0,-1.0)) - 1.0 === pow( 0, 0.0) - 0.0 === pow( 0, 1.0) - 0.0 === pow( 0, 2.0) - 1.0 === pow( 1,-2.0) - 1.0 === pow( 1,-1.0) - 1.0 === pow( 1, 0.0) - 1.0 === pow( 1, 1.0) - 1.0 === pow( 1, 2.0) - 0.25 === pow( 2,-2.0) - 0.5 === pow( 2,-1.0) - 1.0 === pow( 2, 0.0) - 2.0 === pow( 2, 1.0) - 4.0 === pow( 2, 2.0) - 2147483648 === pow(2,31) --2147483648 ~== pow(-2,31) - 1000000000 === pow(10,9) - 100000000 === pow(-10,8) - 1 === pow(-1,1443279822) --1 === pow(-1,1443279821) -sqrt(2) ~== pow(2,1/2) - 0.25 === pow(-2.0,-2.0) --0.5 === pow(-2.0,-1.0) - 1.0 === pow(-2.0, 0.0) --2.0 === pow(-2.0, 1.0) - 4.0 === pow(-2.0, 2.0) - 1.0 === pow(-1.0,-2.0) --1.0 === pow(-1.0,-1.0) - 1.0 === pow(-1.0, 0.0) --1.0 === pow(-1.0, 1.0) - 1.0 === pow(-1.0, 2.0) - TRUE === is_infinite(pow(0.0,-2.0)) - TRUE === is_infinite(pow(0.0,-1.0)) - 1.0 === pow( 0.0, 0.0) - 0.0 === pow( 0.0, 1.0) - 0.0 === pow( 0.0, 2.0) - 1.0 === pow( 1.0,-2.0) - 1.0 === pow( 1.0,-1.0) - 1.0 === pow( 1.0, 0.0) - 1.0 === pow( 1.0, 1.0) - 1.0 === pow( 1.0, 2.0) - 0.25 === pow( 2.0,-2.0) - 0.5 === pow( 2.0,-1.0) - 1.0 === pow( 2.0, 0.0) - 2.0 === pow( 2.0, 1.0) - 4.0 === pow( 2.0, 2.0) - 0.25 === pow(-2.0,-2) --0.5 === pow(-2.0,-1) - 1.0 === pow(-2.0, 0) --2.0 === pow(-2.0, 1) - 4.0 === pow(-2.0, 2) - 1.0 === pow(-1.0,-2) --1.0 === pow(-1.0,-1) - 1.0 === pow(-1.0, 0) --1.0 === pow(-1.0, 1) - 1.0 === pow(-1.0, 2) - TRUE === is_infinite(pow( 0.0,-2)) - TRUE === is_infinite(pow( 0.0,-1)) - 1.0 === pow( 0.0, 0) - 0.0 === pow( 0.0, 1) - 0.0 === pow( 0.0, 2) - 1.0 === pow( 1.0,-2) - 1.0 === pow( 1.0,-1) - 1.0 === pow( 1.0, 0) - 1.0 === pow( 1.0, 1) - 1.0 === pow( 1.0, 2) - 0.25 === pow( 2.0,-2) - 0.5 === pow( 2.0,-1) - 1.0 === pow( 2.0, 0) - 2.0 === pow( 2.0, 1) - 4.0 === pow( 2.0, 2) - 2.0 === pow( 4, 0.5) - 2.0 === pow( 4.0, 0.5) - 3.0 === pow( 27, 1/3) - 3.0 === pow(27.0, 1/3) - 0.5 === pow( 4, -0.5) - 0.5 === pow( 4.0, -0.5) -LONG_MAX-1 === pow(LONG_MAX-1,1) -LONG_MIN+1 === pow(LONG_MIN+1,1) -(LONG_MAX-1)*(LONG_MAX-1) ~== pow(LONG_MAX-1,2) -(LONG_MIN+1)*(LONG_MIN+1) ~== pow(LONG_MIN+1,2) -(float)(LONG_MAX-1) === pow(LONG_MAX-1,1.0) -(float)(LONG_MIN+1) === pow(LONG_MIN+1,1.0) -(LONG_MAX-1)*(LONG_MAX-1) ~== pow(LONG_MAX-1,2.0) -(LONG_MIN+1)*(LONG_MIN+1) ~== pow(LONG_MIN+1,2.0) -LONG_MAX === pow(LONG_MAX,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) -(float)LONG_MIN === pow(LONG_MIN,1.0) -LONG_MAX*LONG_MAX ~== pow(LONG_MAX,2.0) -LONG_MIN*LONG_MIN ~== pow(LONG_MIN,2.0) -TESTS; - - echo "On failure, please mail result to php-dev@lists.php.net\n"; - include(dirname(__FILE__) . '/../../../../tests/quicktester.inc'); - ---EXPECT-- -1,1,0,0 -On failure, please mail result to php-dev@lists.php.net -OK diff --git a/ext/standard/tests/math/round.phpt b/ext/standard/tests/math/round.phpt deleted file mode 100644 index 47f57dad18..0000000000 --- a/ext/standard/tests/math/round.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Simple math tests ---FILE-- -<?php // $Id$ - -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(dirname(__FILE__) . '/../../../../tests/quicktester.inc'); ---EXPECT-- -1,1,0,0 -OK |