1--TEST--
2Test return type and value for expected input acos()
3--INI--
4precision = 14
5--FILE--
6<?php
7/*
8 * proto float acos(float number)
9 * Function is implemented in ext/standard/math.c
10*/
11
12$file_path = dirname(__FILE__);
13require($file_path."/allowed_rounding_error.inc");
14
15
16//output is in degrees
17
18echo "acos .5  = ";
19$acosv1 = 360.0  * acos(0.5) / (2.0 * M_PI );
20var_dump($acosv1);
21if (allowed_rounding_error($acosv1 ,60 )) {
22	echo "Pass\n";
23}
24else {
25	echo "Fail\n";
26}
27
28echo "acos 0.86602540378444 = ";
29$acosv2 = 360.0  * acos(0.86602540378444) / (2.0 * M_PI );
30var_dump($acosv2);
31if (allowed_rounding_error($acosv2 ,30 )) {
32	echo "Pass\n";
33}
34else {
35	echo "Fail\n";
36}
37
38
39echo "acos 1.0 = ";
40$acosv3 = 360.0  * acos(1.0) / (2.0 * M_PI);
41var_dump($acosv3);
42if (allowed_rounding_error($acosv3 ,0 )) {
43	echo "Pass\n";
44}
45else {
46	echo "Fail\n";
47}
48
49
50echo "acos 0.0 = ";
51$acosv4 = 360.0  * acos(0.0) / (2.0 * M_PI );
52var_dump($acosv4);
53if (allowed_rounding_error($acosv3 ,0 )) {
54	echo "Pass\n";
55}
56else {
57	echo "Fail\n";
58}
59
60?>
61--EXPECTF--
62acos .5  = float(%f)
63Pass
64acos 0.86602540378444 = float(%f)
65Pass
66acos 1.0 = float(%f)
67Pass
68acos 0.0 = float(%f)
69Pass
70