Home | History | Annotate | Download | only in test

Lines Matching defs:INF

12 INF = float("inf")
171 self.assertFalse(float("inf").is_integer())
202 self.assertRaises(OverflowError, float('inf').as_integer_ratio)
203 self.assertRaises(OverflowError, float('-inf').as_integer_ratio)
239 self.assertTrue(isnan(pow_op(-INF, NAN)))
247 self.assertTrue(isnan(pow_op(INF, NAN)))
251 self.assertTrue(isnan(pow_op(NAN, -INF)))
258 self.assertTrue(isnan(pow_op(NAN, INF)))
281 # (-1)**+-inf is 1
282 self.assertEqualAndEqualSign(pow_op(-1.0, -INF), 1.0)
283 self.assertEqualAndEqualSign(pow_op(-1.0, INF), 1.0)
286 self.assertEqualAndEqualSign(pow_op(1.0, -INF), 1.0)
295 self.assertEqualAndEqualSign(pow_op(1.0, INF), 1.0)
299 self.assertEqualAndEqualSign(pow_op(-INF, 0.0), 1.0)
308 self.assertEqualAndEqualSign(pow_op(INF, 0.0), 1.0)
310 self.assertEqualAndEqualSign(pow_op(-INF, -0.0), 1.0)
319 self.assertEqualAndEqualSign(pow_op(INF, -0.0), 1.0)
330 # x**-INF is INF for abs(x) < 1
331 self.assertEqualAndEqualSign(pow_op(-0.5, -INF), INF)
332 self.assertEqualAndEqualSign(pow_op(-0.0, -INF), INF)
333 self.assertEqualAndEqualSign(pow_op(0.0, -INF), INF)
334 self.assertEqualAndEqualSign(pow_op(0.5, -INF), INF)
336 # x**-INF is 0 for abs(x) > 1
337 self.assertEqualAndEqualSign(pow_op(-INF, -INF), 0.0)
338 self.assertEqualAndEqualSign(pow_op(-2.0, -INF), 0.0)
339 self.assertEqualAndEqualSign(pow_op(2.0, -INF), 0.0)
340 self.assertEqualAndEqualSign(pow_op(INF, -INF), 0.0)
342 # x**INF is 0 for abs(x) < 1
343 self.assertEqualAndEqualSign(pow_op(-0.5, INF), 0.0)
344 self.assertEqualAndEqualSign(pow_op(-0.0, INF), 0.0)
345 self.assertEqualAndEqualSign(pow_op(0.0, INF), 0.0)
346 self.assertEqualAndEqualSign(pow_op(0.5, INF), 0.0)
348 # x**INF is INF for abs(x) > 1
349 self.assertEqualAndEqualSign(pow_op(-INF, INF), INF)
350 self.assertEqualAndEqualSign(pow_op(-2.0, INF), INF)
351 self.assertEqualAndEqualSign(pow_op(2.0, INF), INF)
352 self.assertEqualAndEqualSign(pow_op(INF, INF), INF)
354 # (-INF)**y is -0.0 for y a negative odd integer
355 self.assertEqualAndEqualSign(pow_op(-INF, -1.0), -0.0)
357 # (-INF)**y is 0.0 for y negative but not an odd integer
358 self.assertEqualAndEqualSign(pow_op(-INF, -0.5), 0.0)
359 self.assertEqualAndEqualSign(pow_op(-INF, -2.0), 0.0)
361 # (-INF)**y is -INF for y a positive odd integer
362 self.assertEqualAndEqualSign(pow_op(-INF, 1.0), -INF)
364 # (-INF)**y is INF for y positive but not an odd integer
365 self.assertEqualAndEqualSign(pow_op(-INF, 0.5), INF)
366 INF, 2.0), INF)
368 # INF**y is INF for y positive
369 self.assertEqualAndEqualSign(pow_op(INF, 0.5), INF)
370 self.assertEqualAndEqualSign(pow_op(INF, 1.0), INF)
371 self.assertEqualAndEqualSign(pow_op(INF, 2.0), INF)
373 # INF**y is 0.0 for y negative
374 self.assertEqualAndEqualSign(pow_op(INF, -2.0), 0.0)
375 self.assertEqualAndEqualSign(pow_op(INF, -1.0), 0.0)
376 self.assertEqualAndEqualSign(pow_op(INF, -0.5), 0.0)
601 # issue 3382: 'f' and 'F' with inf's and nan's
602 self.assertEqual('{0:f}'.format(INF), 'inf')
603 self.assertEqual('{0:F}'.format(INF), 'INF')
604 self.assertEqual('{0:f}'.format(-INF), '-inf')
605 self.assertEqual('{0:F}'.format(-INF), '-INF')
710 self.assertEqual(round(INF), INF)
711 self.assertEqual(round(-INF), -INF)
714 self.assertEqual(round(INF, n), INF)
715 self.assertEqual(round(-INF, n), -INF)
718 self.assertRaises(TypeError, round, INF, 0.0)
719 self.assertRaises(TypeError, round, -INF, 1.0)
849 test(fmt, INF, 'inf')
850 test(fmt, -INF, '-inf')
855 test(pfmt, INF, '+inf')
856 test(pfmt, -INF, '-inf')
861 test(sfmt, INF, ' inf')
862 test(sfmt, -INF, '-inf')
868 # ways to create and represent inf and nan
871 self.assertTrue(isinf(float("inf")))
872 self.assertTrue(isinf(float("+inf")))
873 self.assertTrue(isinf(float("-inf")))
878 self.assertEqual(repr(float("inf")), "inf")
879 self.assertEqual(repr(float("+inf")), "inf")
880 self.assertEqual(repr(float("-inf")), "-inf")
881 self.assertEqual(repr(float("infinity")), "inf")
882 self.assertEqual(repr(float("+infinity")), "inf")
883 self.assertEqual(repr(float("-infinity")), "-inf")
885 self.assertEqual(repr(float("INF")), "inf")
886 self.assertEqual(repr(float("+Inf")), "inf")
887 self.assertEqual(repr(float("-iNF")), "-inf")
888 self.assertEqual(repr(float("Infinity")), "inf")
889 self.assertEqual(repr(float("+iNfInItY")), "inf")
890 self.assertEqual(repr(float("-INFINITY")), "-inf")
892 self.assertEqual(str(float("inf")), "inf")
893 self.assertEqual(str(float("+inf")), "inf")
894 self.assertEqual(str(float("-inf")), "-inf")
895 self.assertEqual(str(float("infinity")), "inf")
896 self.assertEqual(str(float("+infinity")), "inf")
897 self.assertEqual(str(float("-infinity")), "-inf")
911 self.assertEqual(repr(1e300 * 1e300), "inf")
912 self.assertEqual(repr(-1e300 * 1e300), "-inf")
914 self.assertEqual(str(1e300 * 1e300), "inf")
915 self.assertEqual(str(-1e300 * 1e300), "-inf")
950 self.assertFalse(INF.is_nan())
954 self.assertTrue(INF.is_inf())
962 self.assertEqual(hash(float('inf')), 314159)
963 self.assertEqual(hash(float('-inf')), -271828)
995 '++inf',
996 '-+Inf',
1057 ('inf', INF),
1058 ('-Infinity', -INF),
1088 self.identical(fromHex('inf'), INF)
1089 self.identical(fromHex('+Inf'), INF)
1090 self.identical(fromHex('-INF'), -INF)
1091 self.identical(fromHex('iNf'), INF)
1092 self.identical(fromHex('Infinity'), INF)
1093 self.identical(fromHex('+INFINITY'), INF)
1094 self.identical(fromHex('-infinity'), -INF)
1095 self.identical(fromHex('-iNFiNitY'), -INF)
1371 for x in [NAN, INF, self.MAX, self.MIN, self.MIN-self.TINY, self.TINY, 0.0]: