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