mirror of
https://github.com/php/php-src.git
synced 2024-10-22 08:47:29 +00:00
53 lines
760 B
Plaintext
53 lines
760 B
Plaintext
|
--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);
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
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)
|
||
|
float(1)
|
||
|
float(0.5623790763)
|
||
|
float(0.5623790763)
|
||
|
float(1)
|
||
|
float(0.5403023059)
|
||
|
float(1)
|