Back to index

python3.2  3.2.2
Public Member Functions
test.test_float.InfNanTest Class Reference

List of all members.

Public Member Functions

def test_inf_from_str
def test_inf_as_str
def test_nan_from_str
def test_nan_as_str
def notest_float_nan
def notest_float_inf

Detailed Description

Definition at line 768 of file test_float.py.


Member Function Documentation

Definition at line 862 of file test_float.py.

00862 
00863     def notest_float_inf(self):
00864         self.assertTrue(INF.is_inf())
00865         self.assertFalse(NAN.is_inf())
00866         self.assertFalse((0.).is_inf())

Here is the call graph for this function:

Definition at line 857 of file test_float.py.

00857 
00858     def notest_float_nan(self):
00859         self.assertTrue(NAN.is_nan())
00860         self.assertFalse(INF.is_nan())
00861         self.assertFalse((0.).is_nan())

Here is the call graph for this function:

Definition at line 814 of file test_float.py.

00814 
00815     def test_inf_as_str(self):
00816         self.assertEqual(repr(1e300 * 1e300), "inf")
00817         self.assertEqual(repr(-1e300 * 1e300), "-inf")
00818 
00819         self.assertEqual(str(1e300 * 1e300), "inf")
00820         self.assertEqual(str(-1e300 * 1e300), "-inf")

Here is the call graph for this function:

Definition at line 769 of file test_float.py.

00769 
00770     def test_inf_from_str(self):
00771         self.assertTrue(isinf(float("inf")))
00772         self.assertTrue(isinf(float("+inf")))
00773         self.assertTrue(isinf(float("-inf")))
00774         self.assertTrue(isinf(float("infinity")))
00775         self.assertTrue(isinf(float("+infinity")))
00776         self.assertTrue(isinf(float("-infinity")))
00777 
00778         self.assertEqual(repr(float("inf")), "inf")
00779         self.assertEqual(repr(float("+inf")), "inf")
00780         self.assertEqual(repr(float("-inf")), "-inf")
00781         self.assertEqual(repr(float("infinity")), "inf")
00782         self.assertEqual(repr(float("+infinity")), "inf")
00783         self.assertEqual(repr(float("-infinity")), "-inf")
00784 
00785         self.assertEqual(repr(float("INF")), "inf")
00786         self.assertEqual(repr(float("+Inf")), "inf")
00787         self.assertEqual(repr(float("-iNF")), "-inf")
00788         self.assertEqual(repr(float("Infinity")), "inf")
00789         self.assertEqual(repr(float("+iNfInItY")), "inf")
00790         self.assertEqual(repr(float("-INFINITY")), "-inf")
00791 
00792         self.assertEqual(str(float("inf")), "inf")
00793         self.assertEqual(str(float("+inf")), "inf")
00794         self.assertEqual(str(float("-inf")), "-inf")
00795         self.assertEqual(str(float("infinity")), "inf")
00796         self.assertEqual(str(float("+infinity")), "inf")
00797         self.assertEqual(str(float("-infinity")), "-inf")
00798 
00799         self.assertRaises(ValueError, float, "info")
00800         self.assertRaises(ValueError, float, "+info")
00801         self.assertRaises(ValueError, float, "-info")
00802         self.assertRaises(ValueError, float, "in")
00803         self.assertRaises(ValueError, float, "+in")
00804         self.assertRaises(ValueError, float, "-in")
00805         self.assertRaises(ValueError, float, "infinit")
00806         self.assertRaises(ValueError, float, "+Infin")
00807         self.assertRaises(ValueError, float, "-INFI")
00808         self.assertRaises(ValueError, float, "infinitys")
00809 
00810         self.assertRaises(ValueError, float, "++Inf")
00811         self.assertRaises(ValueError, float, "-+inf")
00812         self.assertRaises(ValueError, float, "+-infinity")
00813         self.assertRaises(ValueError, float, "--Infinity")

Here is the call graph for this function:

Definition at line 850 of file test_float.py.

00850 
00851     def test_nan_as_str(self):
00852         self.assertEqual(repr(1e300 * 1e300 * 0), "nan")
00853         self.assertEqual(repr(-1e300 * 1e300 * 0), "nan")
00854 
00855         self.assertEqual(str(1e300 * 1e300 * 0), "nan")
00856         self.assertEqual(str(-1e300 * 1e300 * 0), "nan")

Here is the call graph for this function:

Definition at line 821 of file test_float.py.

00821 
00822     def test_nan_from_str(self):
00823         self.assertTrue(isnan(float("nan")))
00824         self.assertTrue(isnan(float("+nan")))
00825         self.assertTrue(isnan(float("-nan")))
00826 
00827         self.assertEqual(repr(float("nan")), "nan")
00828         self.assertEqual(repr(float("+nan")), "nan")
00829         self.assertEqual(repr(float("-nan")), "nan")
00830 
00831         self.assertEqual(repr(float("NAN")), "nan")
00832         self.assertEqual(repr(float("+NAn")), "nan")
00833         self.assertEqual(repr(float("-NaN")), "nan")
00834 
00835         self.assertEqual(str(float("nan")), "nan")
00836         self.assertEqual(str(float("+nan")), "nan")
00837         self.assertEqual(str(float("-nan")), "nan")
00838 
00839         self.assertRaises(ValueError, float, "nana")
00840         self.assertRaises(ValueError, float, "+nana")
00841         self.assertRaises(ValueError, float, "-nana")
00842         self.assertRaises(ValueError, float, "na")
00843         self.assertRaises(ValueError, float, "+na")
00844         self.assertRaises(ValueError, float, "-na")
00845 
00846         self.assertRaises(ValueError, float, "++nan")
00847         self.assertRaises(ValueError, float, "-+NAN")
00848         self.assertRaises(ValueError, float, "+-NaN")
00849         self.assertRaises(ValueError, float, "--nAn")

Here is the call graph for this function:


The documentation for this class was generated from the following file: