libm-test-carg.inc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Test carg.
  2. Copyright (C) 1997-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include "libm-test-driver.c"
  16. static const struct test_c_f_data carg_test_data[] =
  17. {
  18. /* carg (x + iy) is specified as atan2 (y, x) */
  19. /* carg (inf + i y) == +0 for finite y > 0. */
  20. TEST_c_f (carg, plus_infty, 2.0, 0),
  21. /* carg (inf + i y) == -0 for finite y < 0. */
  22. TEST_c_f (carg, plus_infty, -2.0, minus_zero),
  23. /* carg(x + i inf) == pi/2 for finite x. */
  24. TEST_c_f (carg, 10.0, plus_infty, lit_pi_2_d),
  25. /* carg(x - i inf) == -pi/2 for finite x. */
  26. TEST_c_f (carg, 10.0, minus_infty, -lit_pi_2_d),
  27. /* carg (-inf + i y) == +pi for finite y > 0. */
  28. TEST_c_f (carg, minus_infty, 10.0, lit_pi),
  29. /* carg (-inf + i y) == -pi for finite y < 0. */
  30. TEST_c_f (carg, minus_infty, -10.0, -lit_pi),
  31. TEST_c_f (carg, plus_infty, plus_infty, lit_pi_4_d),
  32. TEST_c_f (carg, plus_infty, minus_infty, -lit_pi_4_d),
  33. TEST_c_f (carg, minus_infty, plus_infty, lit_pi_3_m_4_d),
  34. TEST_c_f (carg, minus_infty, minus_infty, -lit_pi_3_m_4_d),
  35. TEST_c_f (carg, qnan_value, qnan_value, qnan_value),
  36. AUTO_TESTS_c_f (carg),
  37. };
  38. static void
  39. carg_test (void)
  40. {
  41. ALL_RM_TEST (carg, 0, carg_test_data, RUN_TEST_LOOP_c_f, END);
  42. }
  43. static void
  44. do_test (void)
  45. {
  46. carg_test ();
  47. }
  48. /*
  49. * Local Variables:
  50. * mode:c
  51. * End:
  52. */