FP Expressions.
Floating-point expressions.
Definition at line 8837 of file z3py.py.
def __div__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self / other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x / y
x / y
>>> (x / y).sort()
FPSort(8, 24)
>>> 10 / y
1.25*(2**3) / y
Definition at line 8970 of file z3py.py.
8970 def __div__(self, other):
8971 """Create the Z3 expression `self / other`.
8973 >>> x = FP('x', FPSort(8, 24))
8974 >>> y = FP('y', FPSort(8, 24))
8982 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8983 return fpDiv(_dflt_rm(), a, b, self.ctx)
def fpDiv(rm, a, b, ctx=None)
Referenced by ArithRef.__truediv__(), BitVecRef.__truediv__(), and FPRef.__truediv__().
def __mul__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self * other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x * y
x * y
>>> (x * y).sort()
FPSort(8, 24)
>>> 10 * y
1.25*(2**3) * y
Definition at line 8929 of file z3py.py.
8929 def __mul__(self, other):
8930 """Create the Z3 expression `self * other`.
8932 >>> x = FP('x', FPSort(8, 24))
8933 >>> y = FP('y', FPSort(8, 24))
8941 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8942 return fpMul(_dflt_rm(), a, b, self.ctx)
def fpMul(rm, a, b, ctx=None)
def __rdiv__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `other / self`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x / y
x / y
>>> x / 10
x / 1.25*(2**3)
Definition at line 8985 of file z3py.py.
8985 def __rdiv__(self, other):
8986 """Create the Z3 expression `other / self`.
8988 >>> x = FP('x', FPSort(8, 24))
8989 >>> y = FP('y', FPSort(8, 24))
8995 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8996 return fpDiv(_dflt_rm(), a, b, self.ctx)
Referenced by ArithRef.__rtruediv__(), BitVecRef.__rtruediv__(), and FPRef.__rtruediv__().
def __sub__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Create the Z3 expression `self - other`.
>>> x = FP('x', FPSort(8, 24))
>>> y = FP('y', FPSort(8, 24))
>>> x - y
x - y
>>> (x - y).sort()
FPSort(8, 24)
Definition at line 8906 of file z3py.py.
8906 def __sub__(self, other):
8907 """Create the Z3 expression `self - other`.
8909 >>> x = FP('x', FPSort(8, 24))
8910 >>> y = FP('y', FPSort(8, 24))
8916 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8917 return fpSub(_dflt_rm(), a, b, self.ctx)
Return the sort of the floating-point expression `self`.
>>> x = FP('1.0', FPSort(8, 24))
>>> x.sort()
FPSort(8, 24)
>>> x.sort() == FPSort(8, 24)
True
Reimplemented from ExprRef.
Definition at line 8840 of file z3py.py.
8841 """Return the sort of the floating-point expression `self`.
8843 >>> x = FP('1.0', FPSort(8, 24))
8846 >>> x.sort() == FPSort(8, 24)
8849 return FPSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
Referenced by QuantifierRef.__getitem__(), FPNumRef.as_string(), ArrayRef.domain(), FPRef.ebits(), ArithRef.is_int(), ArithRef.is_real(), ArrayRef.range(), FPRef.sbits(), BitVecRef.size(), and ExprRef.sort_kind().