Inheritance diagram for AlgebraicNumRef:Public Member Functions | |
| def | approx |
| def | as_decimal |
Public Member Functions inherited from ArithRef | |
| def | sort |
| def | is_int |
| def | is_real |
| def | __add__ |
| def | __radd__ |
| def | __mul__ |
| def | __rmul__ |
| def | __sub__ |
| def | __rsub__ |
| def | __pow__ |
| def | __rpow__ |
| def | __div__ |
| def | __truediv__ |
| def | __rdiv__ |
| def | __rtruediv__ |
| def | __mod__ |
| def | __rmod__ |
| def | __neg__ |
| def | __pos__ |
| def | __le__ |
| def | __lt__ |
| def | __gt__ |
| def | __ge__ |
Public Member Functions inherited from ExprRef | |
| def | as_ast |
| def | get_id |
| def | sort |
| def | sort_kind |
| def | __eq__ |
| def | __ne__ |
| def | decl |
| def | num_args |
| def | arg |
| def | children |
Public Member Functions inherited from AstRef | |
| def | __init__ |
| def | __del__ |
| def | __str__ |
| def | __repr__ |
| def | sexpr |
| def | as_ast |
| def | get_id |
| def | ctx_ref |
| def | eq |
| def | translate |
| def | hash |
Public Member Functions inherited from Z3PPObject | |
| def | use_pp |
Additional Inherited Members | |
Data Fields inherited from AstRef | |
| ast | |
| ctx | |
| def approx | ( | self, | |
precision = 10 |
|||
| ) |
Return a Z3 rational number that approximates the algebraic number `self`. The result `r` is such that |r - self| <= 1/10^precision >>> x = simplify(Sqrt(2)) >>> x.approx(20) 6838717160008073720548335/4835703278458516698824704 >>> x.approx(5) 2965821/2097152
Definition at line 2607 of file z3py.py.
| def as_decimal | ( | self, | |
| prec | |||
| ) |
Return a string representation of the algebraic number `self` in decimal notation using `prec` decimal places >>> x = simplify(Sqrt(2)) >>> x.as_decimal(10) '1.4142135623?' >>> x.as_decimal(20) '1.41421356237309504880?'
Definition at line 2618 of file z3py.py.
1.8.5