sinh_basic.phpt 971 B

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