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