Index: trunk/psLib/src/math/psHistogram.c
===================================================================
--- trunk/psLib/src/math/psHistogram.c	(revision 15045)
+++ trunk/psLib/src/math/psHistogram.c	(revision 17565)
@@ -5,6 +5,6 @@
  *  @author GLG (MHPCC), EAM (IfA)
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-28 00:34:11 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-05-07 23:11:30 $
  *
  *  Copyright 2006 IfA, University of Hawaii
@@ -290,4 +290,6 @@
 		    binNum = PS_MIN (binNum, numBins - 1);
 
+		    // value is in bin 'i' if bound[i] <= value < bound[i]
+
 		    // we may slightly overshoot or undershoot.  creep up or down on the true bin
 		    if (inF32->data.F32[i] < out->bounds->data.F32[binNum]) {
@@ -298,7 +300,7 @@
 			
 		    }
-		    if (inF32->data.F32[i] > out->bounds->data.F32[binNum+1]) {
+		    if (inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) {
 			psTrace("psLib.math", 6, "missed target bin, adjusting: %f vs %f to %f\n", inF32->data.F32[i], out->bounds->data.F32[binNum], out->bounds->data.F32[binNum+1]);
-			while ((inF32->data.F32[i] > out->bounds->data.F32[binNum+1]) && (binNum < numBins - 1)) {
+			while ((inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) && (binNum < numBins - 1)) {
 			    binNum ++;
 			}
