Skip to content

Commit 7f417d1

Browse files
committed
Fix invalid rounding in DurationCalcs.safeExtractAmount
1 parent d7af198 commit 7f417d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/tascalate/concurrent/delays/DurationCalcs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static long safeExtractAmount(Duration duration, int targetDimIdx) {
5454
return amount;
5555
}
5656
double factor = Math.pow(1000, sourceDimIdx - targetDimIdx);
57-
if (Long.MAX_VALUE / amount > factor) {
57+
if ((double)Long.MAX_VALUE / amount > factor) {
5858
return (long)(amount * factor);
5959
} else {
6060
return Long.MAX_VALUE;

0 commit comments

Comments
 (0)