def encrypt(self, value, precision=None, random_value=None):
        """Encode and Paillier encrypt a real number value.
        """
        encoding = FixedPointNumber.encode(value, self.n, self.max_int, precision)
        ciphertext = self.raw_encrypt(encoding.encoding, random_value=random_value)
        encryptednumber = PaillierEncryptedNumber(self, ciphertext, encoding.exponent)

        return encryptednumber
Encode and Paillier encrypt a real number value.
        
fedlearner/model/crypto/paillier.py