Lines Matching refs:pow_op
325 for pow_op in pow, operator.pow:
327 self.assertTrue(isnan(pow_op(-INF, NAN)))
328 self.assertTrue(isnan(pow_op(-2.0, NAN)))
329 self.assertTrue(isnan(pow_op(-1.0, NAN)))
330 self.assertTrue(isnan(pow_op(-0.5, NAN)))
331 self.assertTrue(isnan(pow_op(-0.0, NAN)))
332 self.assertTrue(isnan(pow_op(0.0, NAN)))
333 self.assertTrue(isnan(pow_op(0.5, NAN)))
334 self.assertTrue(isnan(pow_op(2.0, NAN)))
335 self.assertTrue(isnan(pow_op(INF, NAN)))
336 self.assertTrue(isnan(pow_op(NAN, NAN)))
339 self.assertTrue(isnan(pow_op(NAN, -INF)))
340 self.assertTrue(isnan(pow_op(NAN, -2.0)))
341 self.assertTrue(isnan(pow_op(NAN, -1.0)))
342 self.assertTrue(isnan(pow_op(NAN, -0.5)))
343 self.assertTrue(isnan(pow_op(NAN, 0.5)))
344 self.assertTrue(isnan(pow_op(NAN, 1.0)))
345 self.assertTrue(isnan(pow_op(NAN, 2.0)))
346 self.assertTrue(isnan(pow_op(NAN, INF)))
349 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -1.0)
350 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -1.0)
354 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -2.0)
355 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -0.5)
356 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -2.0)
357 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -0.5)
360 self.assertEqualAndEqualSign(pow_op(-0.0, 1.0), -0.0)
361 self.assertEqualAndEqualSign(pow_op(0.0, 1.0), 0.0)
364 self.assertEqualAndEqualSign(pow_op(-0.0, 0.5), 0.0)
365 self.assertEqualAndEqualSign(pow_op(-0.0, 2.0), 0.0)
366 self.assertEqualAndEqualSign(pow_op(0.0, 0.5), 0.0)
367 self.assertEqualAndEqualSign(pow_op(0.0, 2.0), 0.0)
370 self.assertEqualAndEqualSign(pow_op(-1.0, -INF), 1.0)
371 self.assertEqualAndEqualSign(pow_op(-1.0, INF), 1.0)
374 self.assertEqualAndEqualSign(pow_op(1.0, -INF), 1.0)
375 self.assertEqualAndEqualSign(pow_op(1.0, -2.0), 1.0)
376 self.assertEqualAndEqualSign(pow_op(1.0, -1.0), 1.0)
377 self.assertEqualAndEqualSign(pow_op(1.0, -0.5), 1.0)
378 self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
379 self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
380 self.assertEqualAndEqualSign(pow_op(1.0, 0.5), 1.0)
381 self.assertEqualAndEqualSign(pow_op(1.0, 1.0), 1.0)
382 self.assertEqualAndEqualSign(pow_op(1.0, 2.0), 1.0)
383 self.assertEqualAndEqualSign(pow_op(1.0, INF), 1.0)
384 self.assertEqualAndEqualSign(pow_op(1.0, NAN), 1.0)
387 self.assertEqualAndEqualSign(pow_op(-INF, 0.0), 1.0)
388 self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
389 self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
390 self.assertEqualAndEqualSign(pow_op(-0.5, 0.0), 1.0)
391 self.assertEqualAndEqualSign(pow_op(-0.0, 0.0), 1.0)
392 self.assertEqualAndEqualSign(pow_op(0.0, 0.0), 1.0)
393 self.assertEqualAndEqualSign(pow_op(0.5, 0.0), 1.0)
394 self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
395 self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
396 self.assertEqualAndEqualSign(pow_op(INF, 0.0), 1.0)
397 self.assertEqualAndEqualSign(pow_op(NAN, 0.0), 1.0)
398 self.assertEqualAndEqualSign(pow_op(-INF, -0.0), 1.0)
399 self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
400 self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
401 self.assertEqualAndEqualSign(pow_op(-0.5, -0.0), 1.0)
402 self.assertEqualAndEqualSign(pow_op(-0.0, -0.0), 1.0)
403 self.assertEqualAndEqualSign(pow_op(0.0, -0.0), 1.0)
404 self.assertEqualAndEqualSign(pow_op(0.5, -0.0), 1.0)
405 self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
406 self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
407 self.assertEqualAndEqualSign(pow_op(INF, -0.0), 1.0)
408 self.assertEqualAndEqualSign(pow_op(NAN, -0.0), 1.0)
412 self.assertEqual(type(pow_op(-2.0, -0.5)), complex)
413 self.assertEqual(type(pow_op(-2.0, 0.5)), complex)
414 self.assertEqual(type(pow_op(-1.0, -0.5)), complex)
415 self.assertEqual(type(pow_op(-1.0, 0.5)), complex)
416 self.assertEqual(type(pow_op(-0.5, -0.5)), complex)
417 self.assertEqual(type(pow_op(-0.5, 0.5)), complex)
420 self.assertEqualAndEqualSign(pow_op(-0.5, -INF), INF)
421 self.assertEqualAndEqualSign(pow_op(-0.0, -INF), INF)
422 self.assertEqualAndEqualSign(pow_op(0.0, -INF), INF)
423 self.assertEqualAndEqualSign(pow_op(0.5, -INF), INF)
426 self.assertEqualAndEqualSign(pow_op(-INF, -INF), 0.0)
427 self.assertEqualAndEqualSign(pow_op(-2.0, -INF), 0.0)
428 self.assertEqualAndEqualSign(pow_op(2.0, -INF), 0.0)
429 self.assertEqualAndEqualSign(pow_op(INF, -INF), 0.0)
432 self.assertEqualAndEqualSign(pow_op(-0.5, INF), 0.0)
433 self.assertEqualAndEqualSign(pow_op(-0.0, INF), 0.0)
434 self.assertEqualAndEqualSign(pow_op(0.0, INF), 0.0)
435 self.assertEqualAndEqualSign(pow_op(0.5, INF), 0.0)
438 self.assertEqualAndEqualSign(pow_op(-INF, INF), INF)
439 self.assertEqualAndEqualSign(pow_op(-2.0, INF), INF)
440 self.assertEqualAndEqualSign(pow_op(2.0, INF), INF)
441 self.assertEqualAndEqualSign(pow_op(INF, INF), INF)
444 self.assertEqualAndEqualSign(pow_op(-INF, -1.0), -0.0)
447 self.assertEqualAndEqualSign(pow_op(-INF, -0.5), 0.0)
448 self.assertEqualAndEqualSign(pow_op(-INF, -2.0), 0.0)
451 self.assertEqualAndEqualSign(pow_op(-INF, 1.0), -INF)
454 self.assertEqualAndEqualSign(pow_op(-INF, 0.5), INF)
455 self.assertEqualAndEqualSign(pow_op(-INF, 2.0), INF)
458 self.assertEqualAndEqualSign(pow_op(INF, 0.5), INF)
459 self.assertEqualAndEqualSign(pow_op(INF, 1.0), INF)
460 self.assertEqualAndEqualSign(pow_op(INF, 2.0), INF)
463 self.assertEqualAndEqualSign(pow_op(INF, -2.0), 0.0)
464 self.assertEqualAndEqualSign(pow_op(INF, -1.0), 0.0)
465 self.assertEqualAndEqualSign(pow_op(INF, -0.5), 0.0)
468 self.assertEqualAndEqualSign(pow_op(-2.0, -2.0), 0.25)
469 self.assertEqualAndEqualSign(pow_op(-2.0, -1.0), -0.5)
470 self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
471 self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
472 self.assertEqualAndEqualSign(pow_op(-2.0, 1.0), -2.0)
473 self.assertEqualAndEqualSign(pow_op(-2.0, 2.0), 4.0)
474 self.assertEqualAndEqualSign(pow_op(-1.0, -2.0), 1.0)
475 self.assertEqualAndEqualSign(pow_op(-1.0, -1.0), -1.0)
476 self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
477 self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
478 self.assertEqualAndEqualSign(pow_op(-1.0, 1.0), -1.0)
479 self.assertEqualAndEqualSign(pow_op(-1.0, 2.0), 1.0)
480 self.assertEqualAndEqualSign(pow_op(2.0, -2.0), 0.25)
481 self.assertEqualAndEqualSign(pow_op(2.0, -1.0), 0.5)
482 self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
483 self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
484 self.assertEqualAndEqualSign(pow_op(2.0, 1.0), 2.0)
485 self.assertEqualAndEqualSign(pow_op(2.0, 2.0), 4.0)
489 self.assertEqualAndEqualSign(pow_op(1.0, -1e100), 1.0)
490 self.assertEqualAndEqualSign(pow_op(1.0, 1e100), 1.0)
491 self.assertEqualAndEqualSign(pow_op(-1.0, -1e100), 1.0)
492 self.assertEqualAndEqualSign(pow_op(-1.0, 1e100), 1.0)
495 self.assertEqualAndEqualSign(pow_op(-2.0, -2000.0), 0.0)
496 self.assertEqual(type(pow_op(-2.0, -2000.5)), complex)
497 self.assertEqualAndEqualSign(pow_op(-2.0, -2001.0), -0.0)
498 self.assertEqualAndEqualSign(pow_op(2.0, -2000.0), 0.0)
499 self.assertEqualAndEqualSign(pow_op(2.0, -2000.5), 0.0)
500 self.assertEqualAndEqualSign(pow_op(2.0, -2001.0), 0.0)
501 self.assertEqualAndEqualSign(pow_op(-0.5, 2000.0), 0.0)
502 self.assertEqual(type(pow_op(-0.5, 2000.5)), complex)
503 self.assertEqualAndEqualSign(pow_op(-0.5, 2001.0), -0.0)
504 self.assertEqualAndEqualSign(pow_op(0.5, 2000.0), 0.0)
505 self.assertEqualAndEqualSign(pow_op(0.5, 2000.5), 0.0)
506 self.assertEqualAndEqualSign(pow_op(0.5, 2001.0), 0.0)