(self, value)
return n
Returns a Real-type constant of the given value.

        value can be:
          - A Fraction(n,d)
          - A tuple (n,d)
          - A long or int n
          - A float
          - (Optionally) a mpq or mpz object
Returns a Real-type constant of the given value.
Returns a Real - type constant of the given value .
def Real(self, value):
        """ Returns a Real-type constant of the given value.

        value can be:
          - A Fraction(n,d)
          - A tuple (n,d)
          - A long or int n
          - A float
          - (Optionally) a mpq or mpz object
        """
        if value in self.real_constants:
            return self.real_constants[value]

        if is_pysmt_fraction(value):
            val = value
        elif type(value) == tuple:
            val = Fraction(value[0], value[1])
        elif is_python_rational(value):
            val = pysmt_fraction_from_rational(value)
        else:
            raise PysmtTypeError("Invalid type in constant. The type was:" + \
                                 str(type(value)))

        n = self.create_node(node_type=op.REAL_CONSTANT,
                             args=tuple(),
                             payload=val)
        self.real_constants[value] = n
        return n
def Real ( self , value ) : if value in self . real_constants : return self . real_constants [ value ] if is_pysmt_fraction ( value ) : val = value elif type ( value ) == tuple : val = Fraction ( value [ 0 ] , value [ 1 ] ) elif is_python_rational ( value ) : val = pysmt_fraction_from_rational ( value ) else : raise PysmtTypeError ( "Invalid type in constant. The type was:" + str ( type ( value ) ) ) n = self . create_node ( node_type = op . REAL_CONSTANT , args = tuple ( ) , payload = val ) self . real_constants [ value ] = n return n