FP Expressions.
Floating-point expressions.
Definition at line 8818 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 8864 of file z3py.py.
8864 def __add__(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 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 8951 of file z3py.py.
8951 def __div__(self, other):
8952 """Create the Z3 expression `self / other`.
8954 >>> x = FP('x', FPSort(8, 24))
8955 >>> y = FP('y', FPSort(8, 24))
8963 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8964 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 8910 of file z3py.py.
8910 def __mul__(self, other):
8911 """Create the Z3 expression `self * other`.
8913 >>> x = FP('x', FPSort(8, 24))
8914 >>> y = FP('y', FPSort(8, 24))
8922 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8923 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 8966 of file z3py.py.
8966 def __rdiv__(self, other):
8967 """Create the Z3 expression `other / self`.
8969 >>> x = FP('x', FPSort(8, 24))
8970 >>> y = FP('y', FPSort(8, 24))
8976 [a, b] = _coerce_fp_expr_list([other, self], self.ctx)
8977 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 8887 of file z3py.py.
8887 def __sub__(self, other):
8888 """Create the Z3 expression `self - other`.
8890 >>> x = FP('x', FPSort(8, 24))
8891 >>> y = FP('y', FPSort(8, 24))
8897 [a, b] = _coerce_fp_expr_list([self, other], self.ctx)
8898 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 8821 of file z3py.py.
8822 """Return the sort of the floating-point expression `self`.
8824 >>> x = FP('1.0', FPSort(8, 24))
8827 >>> x.sort() == FPSort(8, 24)
8830 return FPSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)