Blame math/libm-test-carg.inc

Packit Service 82fcde
/* Test carg.
Packit Service 82fcde
   Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#include "libm-test-driver.c"
Packit Service 82fcde
Packit Service 82fcde
static const struct test_c_f_data carg_test_data[] =
Packit Service 82fcde
  {
Packit Service 82fcde
    /* carg (x + iy) is specified as atan2 (y, x) */
Packit Service 82fcde
Packit Service 82fcde
    /* carg (inf + i y) == +0 for finite y > 0.  */
Packit Service 82fcde
    TEST_c_f (carg, plus_infty, 2.0, 0),
Packit Service 82fcde
Packit Service 82fcde
    /* carg (inf + i y) == -0 for finite y < 0.  */
Packit Service 82fcde
    TEST_c_f (carg, plus_infty, -2.0, minus_zero),
Packit Service 82fcde
Packit Service 82fcde
    /* carg(x + i inf) == pi/2 for finite x.  */
Packit Service 82fcde
    TEST_c_f (carg, 10.0, plus_infty, lit_pi_2_d),
Packit Service 82fcde
Packit Service 82fcde
    /* carg(x - i inf) == -pi/2 for finite x.  */
Packit Service 82fcde
    TEST_c_f (carg, 10.0, minus_infty, -lit_pi_2_d),
Packit Service 82fcde
Packit Service 82fcde
    /* carg (-inf + i y) == +pi for finite y > 0.  */
Packit Service 82fcde
    TEST_c_f (carg, minus_infty, 10.0, lit_pi),
Packit Service 82fcde
Packit Service 82fcde
    /* carg (-inf + i y) == -pi for finite y < 0.  */
Packit Service 82fcde
    TEST_c_f (carg, minus_infty, -10.0, -lit_pi),
Packit Service 82fcde
Packit Service 82fcde
    TEST_c_f (carg, plus_infty, plus_infty, lit_pi_4_d),
Packit Service 82fcde
Packit Service 82fcde
    TEST_c_f (carg, plus_infty, minus_infty, -lit_pi_4_d),
Packit Service 82fcde
Packit Service 82fcde
    TEST_c_f (carg, minus_infty, plus_infty, lit_pi_3_m_4_d),
Packit Service 82fcde
Packit Service 82fcde
    TEST_c_f (carg, minus_infty, minus_infty, -lit_pi_3_m_4_d),
Packit Service 82fcde
Packit Service 82fcde
    TEST_c_f (carg, qnan_value, qnan_value, qnan_value),
Packit Service 82fcde
Packit Service 82fcde
    AUTO_TESTS_c_f (carg),
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
static void
Packit Service 82fcde
carg_test (void)
Packit Service 82fcde
{
Packit Service 82fcde
  ALL_RM_TEST (carg, 0, carg_test_data, RUN_TEST_LOOP_c_f, END);
Packit Service 82fcde
}
Packit Service 82fcde
Packit Service 82fcde
static void
Packit Service 82fcde
do_test (void)
Packit Service 82fcde
{
Packit Service 82fcde
  carg_test ();
Packit Service 82fcde
}
Packit Service 82fcde
Packit Service 82fcde
/*
Packit Service 82fcde
 * Local Variables:
Packit Service 82fcde
 * mode:c
Packit Service 82fcde
 * End:
Packit Service 82fcde
 */