]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fix possible size bug on bin count.
authorscipio <scipio>
Sun, 5 Aug 2007 22:29:46 +0000 (22:29 +0000)
committerscipio <scipio>
Sun, 5 Aug 2007 22:29:46 +0000 (22:29 +0000)
tos/lib/tossim/sim_noise.h

index 73c9b52cd4147340256f231a209594eda8112f5b..6c9ddfe173301cc77db2988803dd0fd389b26939 100644 (file)
 extern "C" {
 #endif
 
+// BIN_SIZE (the number of bins) has a + 1 in case the range is not
+// evenly divisible by INTERVAL -pal 5.aug.07
 enum {
   NOISE_MIN = -115,
   NOISE_MAX = -5,
   NOISE_MIN_QUANTIZE = -115,
   NOISE_QUANTIZE_INTERVAL = 5,
-  NOISE_BIN_SIZE = (NOISE_MAX - NOISE_MIN)/NOISE_QUANTIZE_INTERVAL,
+  NOISE_BIN_SIZE = ((NOISE_MAX - NOISE_MIN) / NOISE_QUANTIZE_INTERVAL) + 1,
   NOISE_HISTORY = 20,
   NOISE_DEFAULT_ELEMENT_SIZE = 8,
   NOISE_HASHTABLE_SIZE = 128,