zoe             Tue Sep  4 11:18:35 2007 UTC

  Modified files:              
    /php-src/ext/standard/tests/math    acos_basic.phpt tanh_basic.phpt 
                                        asinh_variation.phpt 
                                        allowed_rounding_error.inc 
                                        sin_basic.phpt acos_variation.phpt 
                                        tanh_variation.phpt tan_error.phpt 
                                        sin_variation.phpt sinh_basic.phpt 
                                        asin_error.phpt acosh_basic.phpt 
                                        atanh_error.phpt 
                                        sinh_variation.phpt 
                                        acosh_variation.phpt 
                                        cos_basic.phpt asinh_error.phpt 
                                        cos_variation.phpt acos_error.phpt 
                                        atan_basic.phpt tanh_error.phpt 
                                        cosh_basic.phpt sin_error.phpt 
                                        atan_variation.phpt 
                                        cosh_variation.phpt 
                                        sinh_error.phpt acosh_error.phpt 
                                        tan_basic.phpt cos_error.phpt 
                                        asin_basic.phpt tan_variation.phpt 
                                        atan_error.phpt atanh_basic.phpt 
                                        cosh_error.phpt 
                                        asin_variation.phpt 
                                        atanh_variation.phpt 
                                        asinh_basic.phpt 
  Log:
  Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, 
acosh, atanh.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acos_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acos_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acos_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acos_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,69 @@
+--TEST--
+Test return type and value for expected input acos()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float acos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+
+//output is in degrees
+
+echo "acos .5  = ";
+$acosv1 = 360.0  * acos(0.5) / (2.0 * M_PI );
+var_dump($acosv1);
+if (allowed_rounding_error($acosv1 ,60 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "acos 0.86602540378444 = ";
+$acosv2 = 360.0  * acos(0.86602540378444) / (2.0 * M_PI );
+var_dump($acosv2);
+if (allowed_rounding_error($acosv2 ,30 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+
+echo "acos 1.0 = ";
+$acosv3 = 360.0  * acos(1.0) / (2.0 * M_PI);
+var_dump($acosv3);
+if (allowed_rounding_error($acosv3 ,0 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+
+echo "acos 0.0 = ";
+$acosv4 = 360.0  * acos(0.0) / (2.0 * M_PI );
+var_dump($acosv4);
+if (allowed_rounding_error($acosv3 ,0 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+acos .5  = float(%f)
+Pass
+acos 0.86602540378444 = float(%f)
+Pass
+acos 1.0 = float(%f)
+Pass
+acos 0.0 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tanh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tanh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tanh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tanh_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,60 @@
+--TEST--
+Test return type and value for expected input tanh()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float tanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+
+echo "tanh .5  = ";
+var_dump(tanh(0.5));
+if (allowed_rounding_error(tanh(0.5), 0.46211715726001)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "tanh -0.5  = ";
+var_dump(tanh(-0.5));
+if (allowed_rounding_error(tanh(-0.5), -0.46211715726001)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "tanh 3  = ";
+var_dump(tanh(3.0));
+if (allowed_rounding_error(tanh(3.0),0.99505475368673 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "tanh -3  = ";
+var_dump(tanh(-3.0));
+if (allowed_rounding_error(tanh(-3.0),-0.99505475368673 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+tanh .5  = float(%f)
+Pass
+tanh -0.5  = float(%f)
+Pass
+tanh 3  = float(%f)
+Pass
+tanh -3  = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asinh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asinh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asinh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asinh_variation.phpt        Tue Sep  4 
11:18:35 2007
@@ -0,0 +1,81 @@
+--TEST--
+Test variations in usage of asinh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float asinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test asinh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = asinh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(3.829113652)
+float(-3.829113652)
+float(3.848471992)
+float(-3.848471992)
+float(3.829113652)
+float(3.829113652)
+float(3.829113652)
+float(3.848471992)
+float(3.848471992)
+
+Warning: asinh() expects parameter 1 to be double, string given in %s on line 
27
+NULL
+float(7.60090271)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(7.60090271)
+float(0)
+float(0.881373587)
+float(0)
+--UEXPECTF--
+float(3.829113652)
+float(-3.829113652)
+float(3.848471992)
+float(-3.848471992)
+float(3.829113652)
+float(3.829113652)
+float(3.829113652)
+float(3.848471992)
+float(3.848471992)
+
+Warning: asinh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(7.60090271)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(7.60090271)
+float(0)
+float(0.881373587)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/allowed_rounding_error.inc?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/allowed_rounding_error.inc
diff -u /dev/null php-src/ext/standard/tests/math/allowed_rounding_error.inc:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/allowed_rounding_error.inc  Tue Sep  4 
11:18:35 2007
@@ -0,0 +1,18 @@
+<?php
+function allowed_rounding_error ($number, $expected) {
+
+       //different machines  may give slightly different floating point numbers
+       //This assumes that the results will be the same to + or - 1.0E-10.
+
+       $small_number = 1.0e-10;
+       $min = $expected - $small_number;
+       $max = $expected + $small_number;
+
+       if ($number < $max  && $number > $min ) {
+               return true;
+       }
+       else {
+               return false;
+       }
+}
+?>
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sin_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sin_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sin_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sin_basic.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,92 @@
+--TEST--
+Test return type and value for expected input sin()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float sin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+
+// Use known values to test
+
+$sixty = M_PI / 3.0;
+$thirty = M_PI / 6.0;
+$ninety = M_PI /2.0;
+$oneeighty = M_PI;
+$twoseventy = M_PI * 1.5;
+$threesixty = M_PI * 2.0;
+
+
+echo "sin 30 = ";
+var_dump(sin($thirty));
+if (allowed_rounding_error(sin($thirty),0.5)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sin 60 = ";
+var_dump(sin($sixty));
+if (allowed_rounding_error(sin($sixty),0.86602540378444)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sin 90 = ";
+var_dump(sin($ninety));
+if (allowed_rounding_error(sin($ninety),1.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sin 180 = ";
+var_dump(sin($oneeighty));
+if (allowed_rounding_error(sin($oneeighty),0.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sin 270 = ";
+var_dump(sin($twoseventy));
+if (allowed_rounding_error(sin($twoseventy),-1.0)) {
+       echo "Pass\n";
+}
+else { 
+       echo "Fail\n";
+}
+
+echo "sin 360 = ";
+var_dump(sin($threesixty));
+if (allowed_rounding_error(sin($threesixty),0.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+?>
+--EXPECTF--
+sin 30 = float(%f)
+Pass
+sin 60 = float(%f)
+Pass
+sin 90 = float(%f)
+Pass
+sin 180 = float(%f)
+Pass
+sin 270 = float(%f)
+Pass
+sin 360 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acos_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acos_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acos_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acos_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of acos()
+--INI--
+precision=10
+--FILE--
+<?php
+/* 
+ * proto float acos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test acos with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = acos($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: acos() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(1.570796327)
+float(0)
+float(1.570796327)
+--UEXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: acos() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(1.570796327)
+float(0)
+float(1.570796327)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tanh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tanh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tanh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tanh_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of tanh()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float tanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test tanh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = tanh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(1)
+float(-1)
+float(1)
+float(-1)
+float(1)
+float(1)
+float(1)
+float(1)
+float(1)
+
+Warning: tanh() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(1)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1)
+float(0)
+float(0.761594156)
+float(0)
+--UEXPECTF--
+float(1)
+float(-1)
+float(1)
+float(-1)
+float(1)
+float(1)
+float(1)
+float(1)
+float(1)
+
+Warning: tanh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(1)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1)
+float(0)
+float(0.761594156)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tan_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tan_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tan_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tan_error.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for tan()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float tan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(tan($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(tan());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: tan() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: tan() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sin_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sin_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sin_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sin_variation.phpt  Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of sin()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float sin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test sin with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = sin($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(-0.8462204042)
+float(0.8462204042)
+float(-0.9937407102)
+float(0.9937407102)
+float(-0.8462204042)
+float(-0.8462204042)
+float(-0.8462204042)
+float(-0.9937407102)
+float(-0.9937407102)
+
+Warning: sin() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(0.8268795405)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(0.8268795405)
+float(0)
+float(0.8414709848)
+float(0)
+--UEXPECTF--
+float(-0.8462204042)
+float(0.8462204042)
+float(-0.9937407102)
+float(0.9937407102)
+float(-0.8462204042)
+float(-0.8462204042)
+float(-0.8462204042)
+float(-0.9937407102)
+float(-0.9937407102)
+
+Warning: sin() expects parameter 1 to be double, Unicode string given in %s on 
line 27
+NULL
+float(0.8268795405)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(0.8268795405)
+float(0)
+float(0.8414709848)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sinh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sinh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sinh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sinh_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,60 @@
+--TEST--
+Test return type and value for expected input sinh()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float sinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "sinh .5  = ";
+var_dump(sinh(0.5));
+if (allowed_rounding_error(sinh(0.5),0.52109530549375)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sinh -0.5  = ";
+var_dump(sinh(-0.5));
+if (allowed_rounding_error(sinh(-0.5), -0.52109530549375)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sinh 3  = ";
+var_dump(sinh(3.0));
+if (allowed_rounding_error(sinh(3.0), 10.01787492741)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "sinh -3  = ";
+var_dump(sinh(-3.0));
+if (allowed_rounding_error(sinh(-3.0), -10.01787492741)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+sinh .5  = float(%f)
+Pass
+sinh -0.5  = float(%f)
+Pass
+sinh 3  = float(%f)
+Pass
+sinh -3  = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asin_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asin_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asin_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asin_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for asin()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float asin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(asin($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(asin());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: asin() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: asin() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acosh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acosh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acosh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acosh_basic.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,46 @@
+--TEST--
+Test return type and value for expected input acosh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+       die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float acosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "acosh  1.1276259652064= ";
+var_dump(acosh(1.1276259652064));
+if (allowed_rounding_error(acosh(1.1276259652064), 0.5))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "acosh 10.067661995778= ";
+var_dump(acosh(10.067661995778));
+if (allowed_rounding_error(acosh(10.067661995778), 3.0))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+
+?>
+--EXPECTF--
+acosh  1.1276259652064= float(%f)
+Pass
+acosh 10.067661995778= float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atanh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atanh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atanh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atanh_error.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,35 @@
+--TEST--
+Test wrong number of arguments for atanh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float atanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(atanh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(atanh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: atanh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: atanh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sinh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sinh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sinh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sinh_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of sinh()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float sinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test sinh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = sinh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(4872401723)
+float(-4872401723)
+float(7641446995)
+float(-7641446995)
+float(4872401723)
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+
+Warning: sinh() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(INF)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(INF)
+float(0)
+float(1.175201194)
+float(0)
+--UEXPECTF--
+float(4872401723)
+float(-4872401723)
+float(7641446995)
+float(-7641446995)
+float(4872401723)
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+
+Warning: sinh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(INF)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(INF)
+float(0)
+float(1.175201194)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acosh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acosh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acosh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acosh_variation.phpt        Tue Sep  4 
11:18:35 2007
@@ -0,0 +1,81 @@
+--TEST--
+Test variations in usage of acosh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float acosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test acosh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = acosh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(3.828168471)
+float(NAN)
+float(3.847562739)
+float(NAN)
+float(3.828168471)
+float(3.828168471)
+float(3.828168471)
+float(3.847562739)
+float(3.847562739)
+
+Warning: acosh() expects parameter 1 to be double, string given in %s on line 
27
+NULL
+float(7.60090221)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(7.60090221)
+float(NAN)
+float(0)
+float(NAN)
+--UEXPECTF--
+float(3.828168471)
+float(NAN)
+float(3.847562739)
+float(NAN)
+float(3.828168471)
+float(3.828168471)
+float(3.828168471)
+float(3.847562739)
+float(3.847562739)
+
+Warning: acosh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(7.60090221)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(7.60090221)
+float(NAN)
+float(0)
+float(NAN)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cos_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cos_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cos_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cos_basic.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,92 @@
+--TEST--
+Test return type and value for expected input cos()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float cos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+
+// Use known values to test
+
+$sixty = M_PI / 3.0;
+$thirty = M_PI / 6.0;
+$ninety = M_PI /2.0;
+$oneeighty = M_PI;
+$twoseventy = M_PI * 1.5;
+$threesixty = M_PI * 2.0;
+
+
+echo "cos 30 = ";
+var_dump(cos($thirty));
+if (allowed_rounding_error(cos($thirty),0.86602540378444)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cos 60 = ";
+var_dump(cos($sixty));
+if (allowed_rounding_error(cos($sixty),0.5)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cos 90 = ";
+var_dump(cos($ninety));
+if (allowed_rounding_error(cos($ninety),0.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cos 180 = ";
+var_dump(cos($oneeighty));
+if (allowed_rounding_error(cos($oneeighty),-1.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cos 270 = ";
+var_dump(cos($twoseventy));
+if (allowed_rounding_error(cos($twoseventy),0.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cos 360 = ";
+var_dump(cos($threesixty));
+if (allowed_rounding_error(cos($threesixty),1.0)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+?>
+--EXPECTF--
+cos 30 = float(%f)
+Pass
+cos 60 = float(%f)
+Pass
+cos 90 = float(%f)
+Pass
+cos 180 = float(%f)
+Pass
+cos 270 = float(%f)
+Pass
+cos 360 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asinh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asinh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asinh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asinh_error.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,35 @@
+--TEST--
+Test wrong number of arguments for asinh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float asinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(asinh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(asinh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: asinh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: asinh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cos_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cos_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cos_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cos_variation.phpt  Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of cos()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float cos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test cos with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = cos($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.1117112391)
+float(-0.1117112391)
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.1117112391)
+float(-0.1117112391)
+
+Warning: cos() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(0.5623790763)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(0.5623790763)
+float(1)
+float(0.5403023059)
+float(1)
+--UEXPECTF--
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.1117112391)
+float(-0.1117112391)
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.5328330203)
+float(-0.1117112391)
+float(-0.1117112391)
+
+Warning: cos() expects parameter 1 to be double, Unicode string given in %s on 
line 27
+NULL
+float(0.5623790763)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(0.5623790763)
+float(1)
+float(0.5403023059)
+float(1)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acos_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acos_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acos_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acos_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for acos()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float acos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(acos($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(acos());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: acos() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: acos() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atan_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atan_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atan_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atan_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,40 @@
+--TEST--
+Test return type and value for expected input atan()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float atan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "atan 1.7320508075689 = ";
+$atan1 = 360 * atan(1.7320508075689) / (2.0 * M_PI);
+var_dump($atan1);
+if (allowed_rounding_error($atan1 ,60 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "atan 0.57735026918963 = ";
+$atan2 = 360 * atan(0.57735026918963) / (2.0 * M_PI);
+var_dump($atan2);
+if (allowed_rounding_error($atan2 ,30 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+atan 1.7320508075689 = float(%f)
+Pass
+atan 0.57735026918963 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tanh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tanh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tanh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tanh_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for tanh()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float tanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(tanh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(tanh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: tanh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: tanh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cosh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cosh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cosh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cosh_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,60 @@
+--TEST--
+Test return type and value for expected input cosh()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float cosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "cosh .5  = ";
+var_dump(cosh(0.5));
+if (allowed_rounding_error(cosh(0.5),1.1276259652064)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cosh -0.5  = ";
+var_dump(cosh(-0.5));
+if (allowed_rounding_error(cosh(-0.5),1.1276259652064)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cosh 3  = ";
+var_dump(cosh(3.0));
+if (allowed_rounding_error(cosh(3.0), 10.067661995778)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "cosh -3  = ";
+var_dump(cosh(-3.0));
+if (allowed_rounding_error(cosh(-3.0), 10.067661995778)){
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+cosh .5  = float(%f)
+Pass
+cosh -0.5  = float(%f)
+Pass
+cosh 3  = float(%f)
+Pass
+cosh -3  = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sin_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sin_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sin_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sin_error.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for sin()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float sin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(sin($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(sin());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: sin() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: sin() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atan_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atan_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atan_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atan_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of atan()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float atan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test atan with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = atan($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(1.527345431)
+float(-1.527345431)
+float(1.528178225)
+float(-1.528178225)
+float(1.527345431)
+float(1.527345431)
+float(1.527345431)
+float(1.528178225)
+float(1.528178225)
+
+Warning: atan() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(1.569796327)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1.569796327)
+float(0)
+float(0.7853981634)
+float(0)
+--UEXPECTF--
+float(1.527345431)
+float(-1.527345431)
+float(1.528178225)
+float(-1.528178225)
+float(1.527345431)
+float(1.527345431)
+float(1.527345431)
+float(1.528178225)
+float(1.528178225)
+
+Warning: atan() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(1.569796327)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1.569796327)
+float(0)
+float(0.7853981634)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cosh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cosh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cosh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cosh_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of cosh()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float cosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test cosh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = cosh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+float(4872401723)
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+
+Warning: cosh() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(INF)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(INF)
+float(1)
+float(1.543080635)
+float(1)
+--UEXPECTF--
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+float(4872401723)
+float(4872401723)
+float(4872401723)
+float(7641446995)
+float(7641446995)
+
+Warning: cosh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(INF)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(INF)
+float(1)
+float(1.543080635)
+float(1)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/sinh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/sinh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/sinh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/sinh_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for sinh()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float sinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(sinh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(sinh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: sinh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: sinh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/acosh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/acosh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/acosh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/acosh_error.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,35 @@
+--TEST--
+Test wrong number of arguments for acosh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float acosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(acosh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(acosh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: acosh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: acosh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tan_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tan_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tan_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tan_basic.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,41 @@
+--TEST--
+Test return type and value for expected input tan()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float tan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+$sixty = M_PI / 3.0;
+$thirty = M_PI / 6.0;
+
+echo "tan 60 = ";
+var_dump(tan($sixty));
+if (allowed_rounding_error(tan($sixty),1.7320508075689)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+ 
+echo "tan 30 = ";
+var_dump(tan($thirty));
+if (allowed_rounding_error(tan($thirty),0.57735026918963)) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+tan 60 = float(%f)
+Pass
+tan 30 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cos_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cos_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cos_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cos_error.phpt      Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for cos()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float cos(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(cos($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(cos());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: cos() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: cos() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asin_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asin_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asin_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asin_basic.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,68 @@
+--TEST--
+Test return type and value for expected input asin()
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float asin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+
+//output is in degrees
+
+echo "asin .5  = ";
+$asinv1 = 360.0  * asin(0.5) / (2.0 * M_PI );
+var_dump($asinv1);
+if (allowed_rounding_error($asinv1 ,30 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "asin 0.86602540378444 = ";
+$asinv2 = 360.0  * asin(0.86602540378444) / (2.0 * M_PI );
+var_dump($asinv2);
+if (allowed_rounding_error($asinv2 ,60 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "asin 1.0 = ";
+$asinv3 = 360.0  * asin(1.0) / (2.0 * M_PI );
+var_dump($asinv3);
+if (allowed_rounding_error($asinv3 ,90 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+
+echo "asin 0.0 = ";
+$asinv4 = 360.0  * asin(0.0) / (2.0 * M_PI );
+var_dump($asinv4);
+if (allowed_rounding_error($asinv4 ,0 )) {
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+asin .5  = float(%f)
+Pass
+asin 0.86602540378444 = float(%f)
+Pass
+asin 1.0 = float(%f)
+Pass
+asin 0.0 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/tan_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/tan_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/tan_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/tan_variation.phpt  Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of tan()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float tan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test tan with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = tan($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(1.588153083)
+float(-1.588153083)
+float(8.895619796)
+float(-8.895619796)
+float(1.588153083)
+float(1.588153083)
+float(1.588153083)
+float(8.895619796)
+float(8.895619796)
+
+Warning: tan() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(1.470324156)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1.470324156)
+float(0)
+float(1.557407725)
+float(0)
+--UEXPECTF--
+float(1.588153083)
+float(-1.588153083)
+float(8.895619796)
+float(-8.895619796)
+float(1.588153083)
+float(1.588153083)
+float(1.588153083)
+float(8.895619796)
+float(8.895619796)
+
+Warning: tan() expects parameter 1 to be double, Unicode string given in %s on 
line 27
+NULL
+float(1.470324156)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(1.470324156)
+float(0)
+float(1.557407725)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atan_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atan_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atan_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atan_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for atan()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float atan(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(atan($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(atan());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: atan() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: atan() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atanh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atanh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atanh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atanh_basic.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,46 @@
+--TEST--
+Test return type and value for expected input atanh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+       die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float atanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "atanh  0.46211715726001 = ";
+var_dump(atanh(0.46211715726001));
+if (allowed_rounding_error(atanh(0.46211715726001), 0.5))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "atanh  0.99505475368673 = ";
+var_dump(atanh(0.99505475368673));
+if (allowed_rounding_error(atanh(0.99505475368673), 3.0))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+
+?>
+--EXPECTF--
+atanh  0.46211715726001 = float(%f)
+Pass
+atanh  0.99505475368673 = float(%f)
+Pass
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/cosh_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/cosh_error.phpt
diff -u /dev/null php-src/ext/standard/tests/math/cosh_error.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/cosh_error.phpt     Tue Sep  4 11:18:35 2007
@@ -0,0 +1,30 @@
+--TEST--
+Test wrong number of arguments for cosh()
+--INI--
+--FILE--
+<?php
+/* 
+ * proto float cosh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$arg_0 = 1.0;
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(cosh($arg_0, $extra_arg));
+
+echo "\nToo few arguments\n";
+var_dump(cosh());
+
+?>
+--EXPECTF--
+Too many arguments
+
+Warning: cosh() expects exactly 1 parameter, 2 given in %s on line 11
+NULL
+
+Too few arguments
+
+Warning: cosh() expects exactly 1 parameter, 0 given in %s on line 14
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asin_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asin_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asin_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asin_variation.phpt Tue Sep  4 11:18:35 2007
@@ -0,0 +1,76 @@
+--TEST--
+Test variations in usage of asin()
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float asin(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test asin with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = asin($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: asin() expects parameter 1 to be double, string given in %s on line 27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(0)
+float(1.570796327)
+float(0)
+--UEXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: asin() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(0)
+float(1.570796327)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/atanh_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/atanh_variation.phpt
diff -u /dev/null php-src/ext/standard/tests/math/atanh_variation.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/atanh_variation.phpt        Tue Sep  4 
11:18:35 2007
@@ -0,0 +1,81 @@
+--TEST--
+Test variations in usage of atanh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN" )
+        die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 10
+--FILE--
+<?php
+/* 
+ * proto float atanh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+
+//Test atanh with a different input values
+
+$values = array(23,
+               -23,
+               2.345e1,
+               -2.345e1,
+               0x17,
+               027,
+               "23",
+               "23.45",
+               "2.345e1",
+               "nonsense",                             
+               "1000",
+               "1000ABC",
+               null,
+               true,
+               false); 
+
+for ($i = 0; $i < count($values); $i++) {
+       $res = atanh($values[$i]);
+       var_dump($res);
+}
+
+?>
+--EXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: atanh() expects parameter 1 to be double, string given in %s on line 
27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(0)
+float(INF)
+float(0)
+--UEXPECTF--
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+float(NAN)
+
+Warning: atanh() expects parameter 1 to be double, Unicode string given in %s 
on line 27
+NULL
+float(NAN)
+
+Notice: A non well formed numeric value encountered in %s on line 27
+float(NAN)
+float(0)
+float(INF)
+float(0)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/asinh_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/math/asinh_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/math/asinh_basic.phpt:1.2
--- /dev/null   Tue Sep  4 11:18:35 2007
+++ php-src/ext/standard/tests/math/asinh_basic.phpt    Tue Sep  4 11:18:35 2007
@@ -0,0 +1,45 @@
+--TEST--
+Test return type and value for expected input asinh()
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+       die ("skip - function not supported on Windows");
+?>
+--INI--
+precision = 14
+--FILE--
+<?php
+/* 
+ * proto float asinh(float number)
+ * Function is implemented in ext/standard/math.c
+*/ 
+
+$file_path = dirname(__FILE__);
+require($file_path."/allowed_rounding_error.inc");
+
+echo "asinh  0.52109530549375= ";
+var_dump(asinh(0.52109530549375));
+if (allowed_rounding_error(asinh(0.52109530549375), 0.5))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+echo "asinh 10.01787492741= ";
+var_dump(asinh(10.01787492741));
+if (allowed_rounding_error(asinh(10.01787492741), 3.0))
+{
+       echo "Pass\n";
+}
+else {
+       echo "Fail\n";
+}
+
+?>
+--EXPECTF--
+asinh  0.52109530549375= float(%f)
+Pass
+asinh 10.01787492741= float(%f)
+Pass

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to