We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1827482 commit 1717de1Copy full SHA for 1717de1
src/main/java/com/thealgorithms/randomized/ClosestPair.java
@@ -49,7 +49,7 @@ public static double closest(List<Point> points) {
49
double result = closestRecursiveHelper(points, 0, points.size() - 1);
50
51
// Return distance of closest pair rounded to 2 decimal places
52
- return new BigDecimal(result).setScale(2, RoundingMode.HALF_UP).doubleValue();
+ return new BigDecimal(String.valueOf(result)).setScale(2, RoundingMode.HALF_UP).doubleValue();
53
}
54
55
private static double closestRecursiveHelper(List<Point> points, int left, int right) {
0 commit comments