Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh.
2007-09-04 09:01:02 +00:00
|
|
|
--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);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2008-02-21 17:47:33 +00:00
|
|
|
--EXPECTF--
|
Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh.
2007-09-04 09:01:02 +00:00
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
|
|
|
float(NAN)
|
2008-02-21 17:47:33 +00:00
|
|
|
|
|
|
|
Warning: asin() expects parameter 1 to be double, string given in %s on line %d
|
|
|
|
NULL
|
Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh.
2007-09-04 09:01:02 +00:00
|
|
|
float(NAN)
|
2008-02-21 17:47:33 +00:00
|
|
|
|
|
|
|
Notice: A non well formed numeric value encountered in %s on line %d
|
Test cases for sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh.
2007-09-04 09:01:02 +00:00
|
|
|
float(NAN)
|
|
|
|
float(0)
|
|
|
|
float(1.570796327)
|
|
|
|
float(0)
|