def testEncryptDecryptFloatLargeFiniteNumbers(self):
    logging.debug('Running testEncryptDecryptFloatLargeFiniteNumbers method.')
    # ------- positive large finite numbers ------
    large1 = 1.23456789123456789123456789 * 2**80
    large2 = 1.23456789123456789123456789 * 2**100
    c_large1 = _PAILLIER1.EncryptFloat(large1)
    self.assertEquals(large1, _PAILLIER1.DecryptFloat(c_large1))
    c_large2 = _PAILLIER1.EncryptFloat(large2)
    self.assertEquals(large2, _PAILLIER1.DecryptFloat(c_large2))
    # mantissa with 17 digits.
    c_mantissa17digits = _PAILLIER1.EncryptFloat(
        1234567890.0123456)
    self.assertEquals(1234567890.0123456,
                      _PAILLIER1.DecryptFloat(c_mantissa17digits))
    # mantissa with 18 digits rounds only approximately.
    c_mantissa18digits = _PAILLIER1.EncryptFloat(
        1234567890.01234568)
    decrypted = _PAILLIER1.DecryptFloat(c_mantissa18digits)
    self.assertNotEquals(1234567890.0123456, decrypted)
    self.assertTrue(abs(decrypted - 1234567890.0123456) <= .0000003)
    # absolute largest normal number allowed
    largest_normal = 1.9999999999999998 * 2**389
    c_largest_normal = _PAILLIER1.EncryptFloat(largest_normal)
    self.assertEquals(largest_normal, _PAILLIER1.DecryptFloat(c_largest_normal))
    # larger than largest normal number throws error
    try:
      beyond_largest_normal = 1.0 * 2**390
      _PAILLIER1.EncryptFloat(beyond_largest_normal)
      self.fail()
    except ValueError:
      pass  # success

    # ---- negative  large finite numbers ------
    # mantissa with 17 digits and negative.
    c_mantissa17digits_neg = _PAILLIER1.EncryptFloat(
        -1234567890.0123456)
    self.assertEquals(-1234567890.0123456,
                      _PAILLIER1.DecryptFloat(c_mantissa17digits_neg))
    # mantissa with 18 digits rounds only approximately.
    c_mantissa18digits_neg = _PAILLIER1.EncryptFloat(
        -1234567890.01234568)
    decrypted = _PAILLIER1.DecryptFloat(c_mantissa18digits_neg)
    self.assertNotEquals(-1234567890.0123456, decrypted)
    self.assertTrue(.0000003 <= abs(decrypted - -1234567890.0123456))
    # absolute largest negative normal number allowed
    largest_normal = -1.9999999999999998 * 2**389
    c_largest_normal = _PAILLIER1.EncryptFloat(largest_normal)
    self.assertEquals(largest_normal, _PAILLIER1.DecryptFloat(c_largest_normal))
    # larger magnitude than negative normal number with largest magnituede
    # throws and error
    try:
      beyond_largest_normal = -1.0 * 2**390
      _PAILLIER1.EncryptFloat(beyond_largest_normal)
      self.fail()
    except ValueError:
      pass  # success
dataset/ETHPy150Open google/encrypted-bigquery-client/src/paillier_test.py/PaillierTest.testEncryptDecryptFloatLargeFiniteNumbers/swapped operands of `<=`