Skip to content

Commit

Permalink
Merge pull request #19 from funkemunky/math-is-cool
Browse files Browse the repository at this point in the history
Optimizing utils to run faster on production
  • Loading branch information
Tecnio committed Jun 8, 2022
2 parents 16fdbe7 + 90cd8fb commit 85e643c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Spigot: https://www.spigotmc.org/resources/83198/

Discord: https://discord.gg/7m5AFZTKQ8


# Sponsors
![yklogo](https://www.yourkit.com/images/yklogo.png)

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/tecnio/antihaxerman/util/MathUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ private double getMedian(final List<Double> data) {
}

public boolean isExponentiallySmall(final Number number) {
return number.doubleValue() < 1 && (Double.toString(number.doubleValue()).contains("E") || number.doubleValue() == 0.0);
return Math.abs(number.doubleValue()) < 9E-5;
}

public boolean isExponentiallyLarge(final Number number) {
return number.doubleValue() > 10000 && Double.toString(number.doubleValue()).contains("E");
return Math.abs(number.doubleValue()) > 1E5;
}

public long getGcd(final long current, final long previous) {
Expand Down

0 comments on commit 85e643c

Please sign in to comment.