Z3
 
Loading...
Searching...
No Matches
Public Member Functions
IntNum Class Reference
+ Inheritance diagram for IntNum:

Public Member Functions

int getInt ()
 
long getInt64 ()
 
int getUint ()
 
long getUint64 ()
 
BigInteger getBigInteger ()
 
String toString ()
 

Detailed Description

Integer Numerals

Definition at line 25 of file IntNum.java.

Member Function Documentation

◆ getBigInteger()

BigInteger getBigInteger ( )
inline

Retrieve the BigInteger value.

Definition at line 85 of file IntNum.java.

86 {
87 return new BigInteger(this.toString());
88 }

◆ getInt()

int getInt ( )
inline

Retrieve the int value.

Definition at line 36 of file IntNum.java.

37 {
38 Native.IntPtr res = new Native.IntPtr();
39 if (!Native.getNumeralInt(getContext().nCtx(), getNativeObject(), res))
40 throw new Z3Exception("Numeral is not an int");
41 return res.value;
42 }

◆ getInt64()

long getInt64 ( )
inline

Retrieve the 64-bit int value.

Definition at line 47 of file IntNum.java.

48 {
49 Native.LongPtr res = new Native.LongPtr();
50 if (!Native.getNumeralInt64(getContext().nCtx(), getNativeObject(), res))
51 throw new Z3Exception("Numeral is not an int64");
52 return res.value;
53 }

◆ getUint()

int getUint ( )
inline

Retrieve the unsigned 32-bit value. The returned Java int holds the raw bit pattern; use Integer.toUnsignedLong(v) for unsigned interpretation.

Definition at line 60 of file IntNum.java.

61 {
62 Native.IntPtr res = new Native.IntPtr();
63 if (!Native.getNumeralUint(getContext().nCtx(), getNativeObject(), res))
64 throw new Z3Exception("Numeral is not a uint");
65 return res.value;
66 }

◆ getUint64()

long getUint64 ( )
inline

Retrieve the unsigned 64-bit value. The returned Java long holds the raw bit pattern; use Long.toUnsignedString(v) or getBigInteger() for values exceeding Long.MAX_VALUE.

Definition at line 74 of file IntNum.java.

75 {
76 Native.LongPtr res = new Native.LongPtr();
77 if (!Native.getNumeralUint64(getContext().nCtx(), getNativeObject(), res))
78 throw new Z3Exception("Numeral is not a uint64");
79 return res.value;
80 }

◆ toString()

String toString ( )
inline

Returns a string representation of the numeral.

Definition at line 93 of file IntNum.java.

93 {
94 return Native.getNumeralString(getContext().nCtx(), getNativeObject());
95 }

Referenced by RatNum.getBigIntDenominator(), IntNum.getBigInteger(), and RatNum.getBigIntNumerator().