1--TEST-- 2Test return type and value for expected input tanh() 3--INI-- 4precision = 14 5--FILE-- 6<?php 7/* 8 * proto float tanh(float number) 9 * Function is implemented in ext/standard/math.c 10*/ 11$file_path = dirname(__FILE__); 12require($file_path."/allowed_rounding_error.inc"); 13 14 15echo "tanh .5 = "; 16var_dump(tanh(0.5)); 17if (allowed_rounding_error(tanh(0.5), 0.46211715726001)) { 18 echo "Pass\n"; 19} 20else { 21 echo "Fail\n"; 22} 23 24echo "tanh -0.5 = "; 25var_dump(tanh(-0.5)); 26if (allowed_rounding_error(tanh(-0.5), -0.46211715726001)) { 27 echo "Pass\n"; 28} 29else { 30 echo "Fail\n"; 31} 32 33echo "tanh 3 = "; 34var_dump(tanh(3.0)); 35if (allowed_rounding_error(tanh(3.0),0.99505475368673 )) { 36 echo "Pass\n"; 37} 38else { 39 echo "Fail\n"; 40} 41 42echo "tanh -3 = "; 43var_dump(tanh(-3.0)); 44if (allowed_rounding_error(tanh(-3.0),-0.99505475368673 )) { 45 echo "Pass\n"; 46} 47else { 48 echo "Fail\n"; 49} 50 51?> 52--EXPECTF-- 53tanh .5 = float(%f) 54Pass 55tanh -0.5 = float(%f) 56Pass 57tanh 3 = float(%f) 58Pass 59tanh -3 = float(%f) 60Pass 61