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