Z3
BitVecNum.java
Go to the documentation of this file.
1
18package com.microsoft.z3;
19
20import java.math.BigInteger;
21
25public class BitVecNum extends BitVecExpr
26{
32 public int getInt()
33 {
34 Native.IntPtr res = new Native.IntPtr();
35 if (!Native.getNumeralInt(getContext().nCtx(), getNativeObject(), res)) {
36 throw new Z3Exception("Numeral is not an int");
37 }
38 return res.value;
39 }
40
46 public long getLong()
47 {
48 Native.LongPtr res = new Native.LongPtr();
49 if (!Native.getNumeralInt64(getContext().nCtx(), getNativeObject(), res)) {
50 throw new Z3Exception("Numeral is not a long");
51 }
52 return res.value;
53 }
54
58 public BigInteger getBigInteger()
59 {
60 return new BigInteger(this.toString());
61 }
62
66 @Override
68 {
69 return Native.getNumeralString(getContext().nCtx(), getNativeObject());
70 }
71
76 {
77 return Native.getNumeralBinaryString(getContext().nCtx(), getNativeObject());
78 }
79
80 BitVecNum(Context ctx, long obj)
81 {
82 super(ctx, obj);
83 }
84}
BigInteger getBigInteger()
Definition: BitVecNum.java:58
def String(name, ctx=None)
Definition: z3py.py:10693