git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68555 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -176,7 +176,7 @@ double calculate_manhattan_similarity(struct ngbr_stats *Ri,
/* squared manhattan distance, sum the differences for each dimension */
do {
- val += Ri->mean[n] - Rk->mean[n];
+ val += fabs(Ri->mean[n] - Rk->mean[n]);
} while (n--);
/* the return value should always be in the range 0 - 1 */