Skip to content

Commit

Permalink
Made it compile again.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Nov 1, 2024
1 parent d8a8248 commit f758d6b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ public NaturalNumber abs() {
public NaturalNumber factorial() {
return new NaturalNumber(bigIntegerFactorial());
}

@Override
public NaturalNumber subfactorial() {
return new NaturalNumber(bigIntegerSubfactorial());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,11 @@ public IntegerElement factorial() {
return new IntegerElement(bigIntegerFactorial());
}

@Override
@NonAlgebraic(value="Factorials are never odd")
public IntegerElement subfactorial() {
return new IntegerElement(bigIntegerSubfactorial());
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@ public PositiveInteger factorial() {
return new PositiveInteger(bigIntegerFactorial());
}

@Override
public PositiveInteger subfactorial() {
return new PositiveInteger(bigIntegerSubfactorial());
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public static RationalNumber of(@NotNull BigInteger numerator, @NotNull
return new RationalNumber(numerator, denominator);
}

public static RationalNumber of(@NotNull BigInteger numerator) {
return new RationalNumber(numerator, BigInteger.ONE);
}

public static RationalNumber of(long longValue) {
return of(longValue, 1);
}
Expand Down Expand Up @@ -161,6 +165,10 @@ public RationalNumber minus(RationalNumber subtrahend) {
return plus(subtrahend.times(-1));
}

public BigDecimalElement toBigDecimalElement() {
return BigDecimalElement.of(bigDecimalValue());
}

@Override
public int compareTo(@org.checkerframework.checker.nullness.qual.NonNull RationalNumber compare) {
return numerator.multiply(compare.denominator)
Expand Down

0 comments on commit f758d6b

Please sign in to comment.