tan_basic.phpt 674 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. $file_path = dirname(__FILE__);
  12. require($file_path."/allowed_rounding_error.inc");
  13. $sixty = M_PI / 3.0;
  14. $thirty = M_PI / 6.0;
  15. echo "tan 60 = ";
  16. var_dump(tan($sixty));
  17. if (allowed_rounding_error(tan($sixty),1.7320508075689)) {
  18. echo "Pass\n";
  19. }
  20. else {
  21. echo "Fail\n";
  22. }
  23. echo "tan 30 = ";
  24. var_dump(tan($thirty));
  25. if (allowed_rounding_error(tan($thirty),0.57735026918963)) {
  26. echo "Pass\n";
  27. }
  28. else {
  29. echo "Fail\n";
  30. }
  31. ?>
  32. --EXPECTF--
  33. tan 60 = float(%f)
  34. Pass
  35. tan 30 = float(%f)
  36. Pass