Skip to content

Commit

Permalink
make method more complete
Browse files Browse the repository at this point in the history
carlosuc3m committed Mar 25, 2024
1 parent 14f5c9f commit f9e56f7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/io/bioimage/modelrunner/utils/CommonUtils.java
Original file line number Diff line number Diff line change
@@ -177,35 +177,35 @@ public static String getTime() {
return dateString;
}

public static boolean int32Overflows(int[] arr) {
double div = Integer.MAX_VALUE;
public static boolean int32Overflows(int[] arr, int bytesPerValue) {
double div = Integer.MAX_VALUE / bytesPerValue;
for (int a : arr)
div = div / (double) a;
if (div < 1)
return true;
return false;
}

public static boolean int32Overflows(long[] arr) {
double div = Integer.MAX_VALUE;
public static boolean int32Overflows(long[] arr, int bytesPerValue) {
double div = Integer.MAX_VALUE / bytesPerValue;
for (long a : arr)
div = div / (double) a;
if (div < 1)
return true;
return false;
}

public static boolean int64Overflows(int[] arr) {
double div = Long.MAX_VALUE;
public static boolean int64Overflows(int[] arr, int bytesPerValue) {
double div = Long.MAX_VALUE / bytesPerValue;
for (int a : arr)
div = div / (double) a;
if (div < 1)
return true;
return false;
}

public static boolean int64Overflows(long[] arr) {
double div = Long.MAX_VALUE;
public static boolean int64Overflows(long[] arr, int bytesPerValue) {
double div = Long.MAX_VALUE / bytesPerValue;
for (long a : arr)
div = div / (double) a;
if (div < 1)

0 comments on commit f9e56f7

Please sign in to comment.