From 1206eff91ac8621c6c11b79429b3918d7eddeaac Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:18:42 +0100 Subject: [PATCH] fixed files form Math #79 --- projects/Math/79/org/apache/commons/math/util/MathUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/Math/79/org/apache/commons/math/util/MathUtils.java b/projects/Math/79/org/apache/commons/math/util/MathUtils.java index 46368dc..ad77a56 100644 --- a/projects/Math/79/org/apache/commons/math/util/MathUtils.java +++ b/projects/Math/79/org/apache/commons/math/util/MathUtils.java @@ -1621,9 +1621,9 @@ public static double distance(double[] p1, double[] p2) { * @return the L2 distance between the two points */ public static double distance(int[] p1, int[] p2) { - int sum = 0; + double sum = 0; for (int i = 0; i < p1.length; i++) { - final int dp = p1[i] - p2[i]; + final double dp = p1[i] - p2[i]; sum += dp * dp; } return Math.sqrt(sum);