check ("pow (+1.1, -inf) == +inf", FUNC(pow) (1.1, minus_infty), 0); check ("pow (+inf, -inf) == +inf", FUNC(pow) (plus_infty, minus_infty), 0); check ("pow (-1.1, -inf) == +inf", FUNC(pow) (-1.1, minus_infty), 0); check ("pow (-inf, -inf) == +inf", FUNC(pow) (minus_infty, minus_infty), 0);
check ("pow (+1.1, -inf) == 0", FUNC(pow) (1.1, minus_infty), 0); check ("pow (+inf, -inf) == 0", FUNC(pow) (plus_infty, minus_infty), 0); check ("pow (-1.1, -inf) == 0", FUNC(pow) (-1.1, minus_infty), 0); check ("pow (-inf, -inf) == 0", FUNC(pow) (minus_infty, minus_infty), 0);
pow_test (void){  MATHTYPE x;  check ("pow (+0, +0) == 1", FUNC(pow) (0, 0), 1);  check ("pow (+0, -0) == 1", FUNC(pow) (0, minus_zero), 1);  check ("pow (-0, +0) == 1", FUNC(pow) (minus_zero, 0), 1);  check ("pow (-0, -0) == 1", FUNC(pow) (minus_zero, minus_zero), 1);  check ("pow (+10, +0) == 1", FUNC(pow) (10, 0), 1);  check ("pow (+10, -0) == 1", FUNC(pow) (10, minus_zero), 1);  check ("pow (-10, +0) == 1", FUNC(pow) (-10, 0), 1);  check ("pow (-10, -0) == 1", FUNC(pow) (-10, minus_zero), 1);  check ("pow (NaN, +0) == 1", FUNC(pow) (nan_value, 0), 1);  check ("pow (NaN, -0) == 1", FUNC(pow) (nan_value, minus_zero), 1);  check_isinfp ("pow (+1.1, +inf) == +inf", FUNC(pow) (1.1, plus_infty));  check_isinfp ("pow (+inf, +inf) == +inf", FUNC(pow) (plus_infty, plus_infty));  check_isinfp ("pow (-1.1, +inf) == +inf", FUNC(pow) (-1.1, plus_infty));  check_isinfp ("pow (-inf, +inf) == +inf", FUNC(pow) (minus_infty, plus_infty));  check ("pow (0.9, +inf) == +0", FUNC(pow) (0.9L, plus_infty), 0);  check ("pow (1e-7, +inf) == +0", FUNC(pow) (1e-7L, plus_infty), 0);  check ("pow (-0.9, +inf) == +0", FUNC(pow) (-0.9L, plus_infty), 0);  check ("pow (-1e-7, +inf) == +0", FUNC(pow) (-1e-7L, plus_infty), 0);  check ("pow (+1.1, -inf) == +inf", FUNC(pow) (1.1, minus_infty), 0);  check ("pow (+inf, -inf) == +inf", FUNC(pow) (plus_infty, minus_infty), 0);  check ("pow (-1.1, -inf) == +inf", FUNC(pow) (-1.1, minus_infty), 0);  check ("pow (-inf, -inf) == +inf", FUNC(pow) (minus_infty, minus_infty), 0);  check_isinfp ("pow (0.9, -inf) == +0", FUNC(pow) (0.9L, minus_infty));  check_isinfp ("pow (1e-7, -inf) == +0", FUNC(pow) (1e-7L, minus_infty));  check_isinfp ("pow (-0.9, -inf) == +0", FUNC(pow) (-0.9L, minus_infty));  check_isinfp ("pow (-1e-7, -inf) == +0", FUNC(pow) (-1e-7L, minus_infty));  check_isinfp ("pow (+inf, 1e-7) == +inf", FUNC(pow) (plus_infty, 1e-7L));  check_isinfp ("pow (+inf, 1) == +inf", FUNC(pow) (plus_infty, 1));  check_isinfp ("pow (+inf, 1e7) == +inf", FUNC(pow) (plus_infty, 1e7L));  check ("pow (+inf, -1e-7) == 0", FUNC(pow) (plus_infty, -1e-7L), 0);  check ("pow (+inf, -1) == 0", FUNC(pow) (plus_infty, -1), 0);  check ("pow (+inf, -1e7) == 0", FUNC(pow) (plus_infty, -1e7L), 0);  check_isinfn ("pow (-inf, 1) == -inf", FUNC(pow) (minus_infty, 1));  check_isinfn ("pow (-inf, 11) == -inf", FUNC(pow) (minus_infty, 11));  check_isinfn ("pow (-inf, 1001) == -inf", FUNC(pow) (minus_infty, 1001));  check_isinfp ("pow (-inf, 2) == +inf", FUNC(pow) (minus_infty, 2));  check_isinfp ("pow (-inf, 12) == +inf", FUNC(pow) (minus_infty, 12));  check_isinfp ("pow (-inf, 1002) == +inf", FUNC(pow) (minus_infty, 1002));  check_isinfp ("pow (-inf, 0.1) == +inf", FUNC(pow) (minus_infty, 0.1));  check_isinfp ("pow (-inf, 1.1) == +inf", FUNC(pow) (minus_infty, 1.1));  check_isinfp ("pow (-inf, 11.1) == +inf", FUNC(pow) (minus_infty, 11.1));  check_isinfp ("pow (-inf, 1001.1) == +inf", FUNC(pow) (minus_infty, 1001.1));  check ("pow (-inf, -1) == -0", FUNC(pow) (minus_infty, -1), minus_zero);  check ("pow (-inf, -11) == -0", FUNC(pow) (minus_infty, -11), minus_zero);  check ("pow (-inf, -1001) == -0", FUNC(pow) (minus_infty, -1001), minus_zero);  check ("pow (-inf, -2) == +0", FUNC(pow) (minus_infty, -2), 0);  check ("pow (-inf, -12) == +0", FUNC(pow) (minus_infty, -12), 0);  check ("pow (-inf, -1002) == +0", FUNC(pow) (minus_infty, -1002), 0);  check ("pow (-inf, -0.1) == +0", FUNC(pow) (minus_infty, -0.1), 0);  check ("pow (-inf, -1.1) == +0", FUNC(pow) (minus_infty, -1.1), 0);  check ("pow (-inf, -11.1) == +0", FUNC(pow) (minus_infty, -11.1), 0);  check ("pow (-inf, -1001.1) == +0", FUNC(pow) (minus_infty, -1001.1), 0);  check_isnan ("pow (NaN, NaN) == NaN", FUNC(pow) (nan_value, nan_value));  check_isnan ("pow (0, NaN) == NaN", FUNC(pow) (0, nan_value));  check_isnan ("pow (1, NaN) == NaN", FUNC(pow) (1, nan_value));  check_isnan ("pow (-1, NaN) == NaN", FUNC(pow) (-1, nan_value));  check_isnan ("pow (NaN, 1) == NaN", FUNC(pow) (nan_value, 1));  check_isnan ("pow (NaN, -1) == NaN", FUNC(pow) (nan_value, -1));  x = random_greater (0.0);  check_isnan_ext ("pow (x, NaN) == NaN", FUNC(pow) (x, nan_value), x);  check_isnan_exc ("pow (+1, +inf) == NaN", FUNC(pow) (1, plus_infty),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-1, +inf) == NaN", FUNC(pow) (1, plus_infty),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (+1, -inf) == NaN", FUNC(pow) (1, plus_infty),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-1, -inf) == NaN", FUNC(pow) (1, plus_infty),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-0.1, 1.1) == NaN", FUNC(pow) (-0.1, 1.1),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-0.1, -1.1) == NaN", FUNC(pow) (-0.1, -1.1),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-10.1, 1.1) == NaN", FUNC(pow) (-10.1, 1.1),		   INVALID_EXCEPTION);  check_isnan_exc ("pow (-10.1, -1.1) == NaN", FUNC(pow) (-10.1, -1.1),		   INVALID_EXCEPTION);  check_isinfp_exc ("pow (+0, -1) == +inf", FUNC(pow) (0, -1),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfp_exc ("pow (+0, -11) == +inf", FUNC(pow) (0, -11),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfn_exc ("pow (-0, -1) == -inf", FUNC(pow) (minus_zero, -1),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfn_exc ("pow (-0, -11) == -inf", FUNC(pow) (minus_zero, -11),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfp_exc ("pow (+0, -2) == +inf", FUNC(pow) (0, -2),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfp_exc ("pow (+0, -11.1) == +inf", FUNC(pow) (0, -11.1),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfp_exc ("pow (-0, -2) == +inf", FUNC(pow) (minus_zero, -2),		    DIVIDE_BY_ZERO_EXCEPTION);  check_isinfp_exc ("pow (-0, -11.1) == +inf", FUNC(pow) (minus_zero, -11.1),		    DIVIDE_BY_ZERO_EXCEPTION);  check ("pow (+0, 1) == +0", FUNC(pow) (0, 1), 0);  check ("pow (+0, 11) == +0", FUNC(pow) (0, 11), 0);  check ("pow (-0, 1) == -0", FUNC(pow) (minus_zero, 1), minus_zero);  check ("pow (-0, 11) == -0", FUNC(pow) (minus_zero, 11), minus_zero);  check ("pow (+0, 2) == +0", FUNC(pow) (0, 2), 0);  check ("pow (+0, 11.1) == +0", FUNC(pow) (0, 11.1), 0);  check ("pow (-0, 2) == +0", FUNC(pow) (minus_zero, 2), 0);  check ("pow (-0, 11.1) == +0", FUNC(pow) (minus_zero, 11.1), 0);  x = random_greater (0.0);  check_isinfp_ext ("pow (x, +inf) == +inf for |x| > 1",		    FUNC(pow) (x, plus_infty), x);  x = random_value (-1.0, 1.0);  check_ext ("pow (x, +inf) == +0 for |x| < 1",	     FUNC(pow) (x, plus_infty), 0.0, x);  x = random_greater (0.0);  check_ext ("pow (x, -inf) == +0 for |x| > 1",	     FUNC(pow) (x, minus_infty), 0.0, x);  x = random_value (-1.0, 1.0);  check_isinfp_ext ("pow (x, -inf) == +inf for |x| < 1",		    FUNC(pow) (x, minus_infty), x);  x = random_greater (0.0);  check_isinfp_ext ("pow (+inf, y) == +inf for y > 0",		    FUNC(pow) (plus_infty, x), x);  x = random_less (0.0);  check_ext ("pow (+inf, y) == +0 for y < 0",	     FUNC(pow) (plus_infty, x), 0.0, x);  x = (rand () % 1000000) * 2.0 + 1;	/* Get random odd integer > 0 */  check_isinfn_ext ("pow (-inf, y) == -inf for y an odd integer > 0",		    FUNC(pow) (minus_infty, x), x);  x = ((rand () % 1000000) + 1) * 2.0;	/* Get random even integer > 1 */  check_isinfp_ext ("pow (-inf, y) == +inf for y > 0 and not an odd integer",		    FUNC(pow) (minus_infty, x), x);  x = -((rand () % 1000000) * 2.0 + 1);	/* Get random odd integer < 0 */  check_ext ("pow (-inf, y) == -0 for y an odd integer < 0",	     FUNC(pow) (minus_infty, x), minus_zero, x);  x = ((rand () % 1000000) + 1) * -2.0;	/* Get random even integer < 0 */  check_ext ("pow (-inf, y) == 0 for y < 0 and not an odd integer",	     FUNC(pow) (minus_infty, x), 0.0, x);  x = (rand () % 1000000) * 2.0 + 1;	/* Get random odd integer > 0 */  check_ext ("pow (+0, y) == +0 for y an odd integer > 0",	     FUNC(pow) (0.0, x), 0.0, x);  x = (rand () % 1000000) * 2.0 + 1;	/* Get random odd integer > 0 */  check_ext ("pow (-0, y) == -0 for y an odd integer > 0",	     FUNC(pow) (minus_zero, x), minus_zero, x);  x = ((rand () % 1000000) + 1) * 2.0;	/* Get random even integer > 1 */  check_ext ("pow (+0, y) == +0 for y > 0 and not an odd integer",	     FUNC(pow) (0.0, x), 0.0, x);  x = ((rand () % 1000000) + 1) * 2.0;	/* Get random even integer > 1 */  check_ext ("pow (-0, y) == +0 for y > 0 and not an odd integer",	     FUNC(pow) (minus_zero, x), 0.0, x);}