1--TEST--
2Test return type and value for expected input rad2deg()
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$arg_0 = 0.0;
15$arg_1 = 1.570796327;
16$arg_2 = 3.141592654;
17$arg_3 = 6.283185307;
18
19echo "rad2deg $arg_0= ";
20$r0 = rad2deg($arg_0);
21var_dump($r0);
22if (allowed_rounding_error($r0 ,0 )) {
23    echo "Pass\n";
24}
25else {
26    echo "Fail\n";
27}
28echo "rad2deg $arg_1 = ";
29$r1 = rad2deg($arg_1);
30var_dump($r1);
31if (allowed_rounding_error($r1 ,90.000000011752)) {
32    echo "Pass\n";
33}
34else {
35    echo "Fail\n";
36}
37echo "rad2deg $arg_2  = ";
38$r2 = rad2deg($arg_2);
39var_dump($r2);
40if (allowed_rounding_error($r2 ,180.0000000235 )) {
41    echo "Pass\n";
42}
43else {
44    echo "Fail\n";
45}
46echo "rad2deg $arg_3 = ";
47$r3 = rad2deg($arg_3);
48var_dump($r3);
49if (allowed_rounding_error($r3 ,359.99999998971 )) {
50    echo "Pass\n";
51}
52else {
53    echo "Fail\n";
54}
55?>
56--EXPECTF--
57rad2deg 0= float(%f)
58Pass
59rad2deg 1.570796327 = float(%f)
60Pass
61rad2deg 3.141592654  = float(%f)
62Pass
63rad2deg 6.283185307 = float(%f)
64Pass
65