Return to tan_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Test return type and value for expected input tan() 3: --INI-- 4: precision = 14 5: --FILE-- 6: <?php 7: /* 8: * proto float tan(float number) 9: * Function is implemented in ext/standard/math.c 10: */ 11: 12: $file_path = dirname(__FILE__); 13: require($file_path."/allowed_rounding_error.inc"); 14: 15: $sixty = M_PI / 3.0; 16: $thirty = M_PI / 6.0; 17: 18: echo "tan 60 = "; 19: var_dump(tan($sixty)); 20: if (allowed_rounding_error(tan($sixty),1.7320508075689)) { 21: echo "Pass\n"; 22: } 23: else { 24: echo "Fail\n"; 25: } 26: 27: echo "tan 30 = "; 28: var_dump(tan($thirty)); 29: if (allowed_rounding_error(tan($thirty),0.57735026918963)) { 30: echo "Pass\n"; 31: } 32: else { 33: echo "Fail\n"; 34: } 35: 36: ?> 37: --EXPECTF-- 38: tan 60 = float(%f) 39: Pass 40: tan 30 = float(%f) 41: Pass