Z3
Loading...
Searching...
No Matches
src
api
java
RatNum.java
Go to the documentation of this file.
1
18
package
com.microsoft.z3;
19
20
import
java.math.BigInteger;
21
25
public
class
RatNum
extends
RealExpr
26
{
30
public
IntNum
getNumerator
()
31
{
32
return
new
IntNum
(getContext(), Native.getNumerator(getContext().nCtx(),
33
getNativeObject()));
34
}
35
39
public
IntNum
getDenominator
()
40
{
41
return
new
IntNum
(getContext(), Native.getDenominator(getContext().nCtx(),
42
getNativeObject()));
43
}
44
48
public
BigInteger
getBigIntNumerator
()
49
{
50
IntNum
n =
getNumerator
();
51
return
new
BigInteger(n.
toString
());
52
}
53
57
public
BigInteger
getBigIntDenominator
()
58
{
59
IntNum
n =
getDenominator
();
60
return
new
BigInteger(n.
toString
());
61
}
62
68
public
long
[]
getSmall
()
69
{
70
Native.LongPtr num =
new
Native.LongPtr();
71
Native.LongPtr den =
new
Native.LongPtr();
72
if
(!Native.getNumeralSmall(getContext().nCtx(), getNativeObject(), num, den))
73
throw
new
Z3Exception
(
"Numeral does not fit in int64"
);
74
return
new
long
[] { num.value, den.value };
75
}
76
82
public
long
[]
getRationalInt64
()
83
{
84
Native.LongPtr num =
new
Native.LongPtr();
85
Native.LongPtr den =
new
Native.LongPtr();
86
if
(!Native.getNumeralRationalInt64(getContext().nCtx(), getNativeObject(), num, den))
87
return
null
;
88
return
new
long
[] { num.value, den.value };
89
}
90
96
public
String
toDecimalString
(
int
precision)
97
{
98
return
Native.getNumeralDecimalString(getContext().nCtx(), getNativeObject(),
99
precision);
100
}
101
105
@Override
106
public
String
toString
() {
107
return
Native.getNumeralString(getContext().nCtx(), getNativeObject());
108
}
109
110
RatNum
(
Context
ctx,
long
obj)
111
{
112
super(ctx, obj);
113
}
114
}
com.microsoft.z3.Context
Definition
Context.java:36
com.microsoft.z3.IntNum
Definition
IntNum.java:26
com.microsoft.z3.IntNum.toString
String toString()
Definition
IntNum.java:93
com.microsoft.z3.RatNum
Definition
RatNum.java:26
com.microsoft.z3.RatNum.getBigIntDenominator
BigInteger getBigIntDenominator()
Definition
RatNum.java:57
com.microsoft.z3.RatNum.getSmall
long[] getSmall()
Definition
RatNum.java:68
com.microsoft.z3.RatNum.getDenominator
IntNum getDenominator()
Definition
RatNum.java:39
com.microsoft.z3.RatNum.getBigIntNumerator
BigInteger getBigIntNumerator()
Definition
RatNum.java:48
com.microsoft.z3.RatNum.toDecimalString
String toDecimalString(int precision)
Definition
RatNum.java:96
com.microsoft.z3.RatNum.getRationalInt64
long[] getRationalInt64()
Definition
RatNum.java:82
com.microsoft.z3.RatNum.toString
String toString()
Definition
RatNum.java:106
com.microsoft.z3.RatNum.getNumerator
IntNum getNumerator()
Definition
RatNum.java:30
com.microsoft.z3.RealExpr
Definition
RealExpr.java:24
com.microsoft.z3.Z3Exception
Definition
Z3Exception.java:26
Generated on Fri Jul 17 2026 02:38:47 for Z3 by
1.9.8