FP Expressions.
Floating-point expressions.
Definition at line 8795 of file z3py.py.
def __add__ |
( |
|
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 8841 of file z3py.py.
8841 def __add__(self, other):
8842 """Create the Z3 expression `self + other`.
8844 >>> x = FP('x', FPSort(8, 24))
8845 >>> y = FP('y', FPSort(8, 24))
8851 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8852 return fpAdd(_dflt_rm(), a, b, self.ctx)
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 8928 of file z3py.py.
8928 def __div__(self, other):
8929 """Create the Z3 expression `self / other`.
8931 >>> x = FP('x', FPSort(8, 24))
8932 >>> y = FP('y', FPSort(8, 24))
8940 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8941 return fpDiv(_dflt_rm(), a, b, self.ctx)
Referenced by 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 8887 of file z3py.py.
8887 def __mul__(self, other):
8888 """Create the Z3 expression `self * other`.
8890 >>> x = FP('x', FPSort(8, 24))
8891 >>> y = FP('y', FPSort(8, 24))
8899 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8900 return fpMul(_dflt_rm(), a, b, self.ctx)
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 8943 of file z3py.py.
8943 def __rdiv__(self, other):
8944 """Create the Z3 expression `other / self`.
8946 >>> x = FP('x', FPSort(8, 24))
8947 >>> y = FP('y', FPSort(8, 24))
8953 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8954 return fpDiv(_dflt_rm(), a, b, self.ctx)
Referenced by 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 8864 of file z3py.py.
8864 def __sub__(self, other):
8865 """Create the Z3 expression `self - other`.
8867 >>> x = FP('x', FPSort(8, 24))
8868 >>> y = FP('y', FPSort(8, 24))
8874 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8875 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 8798 of file z3py.py.
8799 """Return the sort of the floating-point expression `self`.
8801 >>> x = FP('1.0', FPSort(8, 24))
8804 >>> x.sort() == FPSort(8, 24)
8807 return FPSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)