From 0096afde22c968f61102f1320c1178d2cc4181fd Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 2 Jul 2005 10:01:25 +0000 Subject: [PATCH] Normalize to 1 if all elements are the same. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1667 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/src/java/com/samskivert/util/IntListUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java b/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java index 66fa313d..564d22b6 100644 --- a/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java @@ -440,7 +440,7 @@ public class IntListUtil /** * Normalizes an array of integers from the bounding [min,max] to * [0.0, 1.0]. If min == max, all elements in the returned array - * will be 0.5. + * will be 1f. */ public static float[] normalize (int[] values) { @@ -454,7 +454,7 @@ public class IntListUtil // If there is no spread, return a flat normalization if (spread == 0) { - Arrays.fill(normalized, 0.5f); + Arrays.fill(normalized, 1f); return normalized; }