summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-10-22 09:46:23 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-10-22 09:46:23 +0000
commit120e9fa63f7ba158d36d767b3a996d2da977a435 (patch)
tree928dcc8697f79be6e0c108c947e3e9a5181b88b2
parent8b4d5cefea14a45129aa0d25bb8cea0852ba6e99 (diff)
downloadphp-git-120e9fa63f7ba158d36d767b3a996d2da977a435.tar.gz
MFH (math tests pass now - at least on my system)
-rw-r--r--ext/standard/tests/math/001.phpt45
-rw-r--r--ext/standard/tests/math/pow.phpt5
2 files changed, 3 insertions, 47 deletions
diff --git a/ext/standard/tests/math/001.phpt b/ext/standard/tests/math/001.phpt
deleted file mode 100644
index a79d32c580..0000000000
--- a/ext/standard/tests/math/001.phpt
+++ /dev/null
@@ -1,45 +0,0 @@
---TEST--
-Simple math tests
---POST--
---GET--
---FILE--
-<?php
-
-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)
--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--
-OK
diff --git a/ext/standard/tests/math/pow.phpt b/ext/standard/tests/math/pow.phpt
index 150db4ad38..40b7151c3e 100644
--- a/ext/standard/tests/math/pow.phpt
+++ b/ext/standard/tests/math/pow.phpt
@@ -3,7 +3,8 @@ Various pow() tests
--POST--
--GET--
--FILE--
-<?php
+<?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 ),
@@ -126,7 +127,7 @@ FALSE ===@pow(LONG_MIN+1,1.0)
(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)