Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Dec 9, 2023
1 parent 5c58c83 commit f9d6545
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public static int scale(int oldmax, int newmax, int value) {
return PRIORITY_USE_DEFAULT_PRIORITY;
}
float p = ((float) (value - 1) / (float) (oldmax - 1));
float eps = (float)0.0001;
if(p*(newmax - 1) > Math.round(p*(newmax - 1)) - eps && p*(newmax - 1) < Math.round(p*(newmax - 1)) + eps){
float eps = (float) 0.0001;
if (p * (newmax - 1) > Math.round(p * (newmax - 1)) - eps
&& p * (newmax - 1) < Math.round(p * (newmax - 1)) + eps) {
return (int) (Math.round(p * (newmax - 1))) + 1;
}
if (p <= 0.5) {
Expand Down

0 comments on commit f9d6545

Please sign in to comment.