We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c620e8 commit 8105a4fCopy full SHA for 8105a4f
src/main/java/it/unipr/analysis/Number.java
@@ -302,9 +302,16 @@ public String toString() {
302
303
@Override
304
public int compareTo(Number other) {
305
+ if (getType() == other.getType()) {
306
+ if (getType() == Type.INT)
307
+ return Integer.compare(this.i, other.i);
308
+ else if (getType() == Type.LONG)
309
+ return Long.compare(this.l, other.l);
310
+ }
311
+
312
+ // Otherwise, fall back to BigInteger comparisons.
313
BigInteger me = toBigInteger(this);
314
BigInteger ot = toBigInteger(other);
-
315
return me.compareTo(ot);
316
}
317
0 commit comments