Lines Matching refs:complex

14 complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]]
15 complex_infinities = [complex(x, y) for x, y in [
37 complex_nans = [complex(x, y) for x, y in [
357 return complex(*polar(z))
360 arg = complex(ar, ai)
361 expected = complex(er, ei)
395 actual = complex(abs(actual.real), actual.imag)
396 expected = complex(abs(expected.real), expected.imag)
398 actual = complex(actual.real, abs(actual.imag))
399 expected = complex(expected.real, abs(expected.imag))
433 check(complex(inf, 0), (inf, 0.))
434 check(complex(-inf, 0), (inf, pi))
435 check(complex(3, inf), (inf, pi / 2))
436 check(complex(5, -inf), (inf, -pi / 2))
437 check(complex(inf, inf), (inf, pi / 4))
438 check(complex(inf, -inf), (inf, -pi / 4))
439 check(complex(-inf, inf), (inf, 3 * pi / 4))
440 check(complex(-inf, -inf), (inf, -3 * pi / 4))
442 check(complex(nan, 0), (nan, nan))
443 check(complex(0, nan), (nan, nan))
444 check(complex(nan, nan), (nan, nan))
445 check(complex(inf, nan), (inf, nan))
446 check(complex(-inf, nan), (inf, nan))
447 check(complex(nan, inf), (inf, nan))
448 check(complex(nan, -inf), (inf, nan))
475 self.assertEqual(phase(complex(0.0, 0.0)), 0.0)
476 self.assertEqual(phase(complex(0.0, -0.0)), -0.0)
477 self.assertEqual(phase(complex(-0.0, 0.0)), pi)
478 self.assertEqual(phase(complex(-0.0, -0.0)), -pi)
481 self.assertAlmostEqual(phase(complex(-INF, -0.0)), -pi)
482 self.assertAlmostEqual(phase(complex(-INF, -2.3)), -pi)
483 self.assertAlmostEqual(phase(complex(-INF, -INF)), -0.75*pi)
484 self.assertAlmostEqual(phase(complex(-2.3, -INF)), -pi/2)
485 self.assertAlmostEqual(phase(complex(-0.0, -INF)), -pi/2)
486 self.assertAlmostEqual(phase(complex(0.0, -INF)), -pi/2)
487 self.assertAlmostEqual(phase(complex(2.3, -INF)), -pi/2)
488 self.assertAlmostEqual(phase(complex(INF, -INF)), -pi/4)
489 self.assertEqual(phase(complex(INF, -2.3)), -0.0)
490 self.assertEqual(phase(complex(INF, -0.0)), -0.0)
491 self.assertEqual(phase(complex(INF, 0.0)), 0.0)
492 self.assertEqual(phase(complex(INF, 2.3)), 0.0)
493 self.assertAlmostEqual(phase(complex(INF, INF)), pi/4)
494 self.assertAlmostEqual(phase(complex(2.3, INF)), pi/2)
495 self.assertAlmostEqual(phase(complex(0.0, INF)), pi/2)
496 self.assertAlmostEqual(phase(complex(-0.0, INF)), pi/2)
497 self.assertAlmostEqual(phase(complex(-2.3, INF)), pi/2)
498 self.assertAlmostEqual(phase(complex(-INF, INF)), 0.75*pi)
499 self.assertAlmostEqual(phase(complex(-INF, 2.3)), pi)
500 self.assertAlmostEqual(phase(complex(-INF, 0.0)), pi)
516 self.assertEqual(abs(complex(NAN, -INF)), INF)
517 self.assertTrue(math.isnan(abs(complex(NAN, -2.3))))
518 self.assertTrue(math.isnan(abs(complex(NAN, -0.0))))
519 self.assertTrue(math.isnan(abs(complex(NAN, 0.0))))
520 self.assertTrue(math.isnan(abs(complex(NAN, 2.3))))
521 self.assertEqual(abs(complex(NAN, INF)), INF)
522 self.assertEqual(abs(complex(-INF, NAN)), INF)
523 self.assertTrue(math.isnan(abs(complex(-2.3, NAN))))
524 self.assertTrue(math.isnan(abs(complex(-0.0, NAN))))
525 self.assertTrue(math.isnan(abs(complex(0.0, NAN))))
526 self.assertTrue(math.isnan(abs(complex(2.3, NAN))))
527 self.assertEqual(abs(complex(INF, NAN)), INF)
528 self.assertTrue(math.isnan(abs(complex(NAN, NAN))))
534 self.assertRaises(OverflowError, abs, complex(1.4e308, 1.4e308))
553 z = complex(x, y)
562 self.assertTrue(cmath.isnan(complex(NAN, 0)))
563 self.assertTrue(cmath.isnan(complex(0, NAN)))
564 self.assertTrue(cmath.isnan(complex(NAN, NAN)))
565 self.assertTrue(cmath.isnan(complex(NAN, INF)))
566 self.assertTrue(cmath.isnan(complex(INF, NAN)))
573 self.assertTrue(cmath.isinf(complex(INF, 0)))
574 self.assertTrue(cmath.isinf(complex(0, INF)))
575 self.assertTrue(cmath.isinf(complex(INF, INF)))
576 self.assertTrue(cmath.isinf(complex(NAN, INF)))
577 self.assertTrue(cmath.isinf(complex(INF, NAN)))