code: def test_float_overflow(self):
      for x in -2.0, -1.0, 0.0, 1.0, 2.0:
          self.assertEqual(float(int(x)), x)
  
      shuge = "12345" * 120
      huge = 1 << 30000
      mhuge = -huge
      namespace = {
          "huge": huge,
          "mhuge": mhuge,
          "shuge": shuge,
          "math": math,
      }
      for test in [
          "float(huge)",
          "float(mhuge)",
          "complex(huge)",
          "complex(mhuge)",
          "complex(huge, 1)",
          "complex(mhuge, 1)",
          "complex(1, huge)",
          "complex(1, mhuge)",
          "1. + huge",
          "huge + 1.",
          "1. + mhuge",
          "mhuge + 1.",
          "1. - huge",
          "huge - 1.",
          "1. - mhuge",
          "mhuge - 1.",
          "1. * huge",
          "huge * 1.",
          "1. * mhuge",
          "mhuge * 1.",
          "1. // huge",
          "huge // 1.",
          "1. // mhuge",
          "mhuge // 1.",
          "1. / huge",
          "huge / 1.",
          "1. / mhuge",
          "mhuge / 1.",
          "1. ** huge",
          "huge ** 1.",
          "1. ** mhuge",
          "mhuge ** 1.",
          "math.sin(huge)",
          "math.sin(mhuge)",
          "math.sqrt(huge)",
          "math.sqrt(mhuge)",  # should do better
          # math.floor() of an int returns an int now
          ##"math.floor(huge)", "math.floor(mhuge)",
      ]:
          self.assertRaises(OverflowError, eval, test, namespace)
  
      # XXX Perhaps float(shuge) can raise OverflowError on some box?
      # The comparison should not.
      self.assertNotEqual(
          float(shuge),
          int(shuge),
          "float(shuge) should not equal int(shuge)",
      )
  
imports: import unittest
  from test import support
  import sys
  import random
  import math
  import array
label_desc: Use image node_id 17 for calling the LongTest obj's underlying member method code with example usage: obj.test_float_overflow() without return types