]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
fix exponential constructor unit tests
authorSvetlana <lana0771711@gmail.com>
Fri, 31 Jul 2020 12:24:26 +0000 (12:24 +0000)
committerSvetlana <lana0771711@gmail.com>
Fri, 31 Jul 2020 12:24:26 +0000 (12:24 +0000)
src/daemon/distribution_test.c

index 77cefe97a3065b79992d63a8c6ec1b86e594c74a..6b3660445fc0310d95efba55f9d8903d67aeed88 100644 (file)
@@ -41,7 +41,7 @@ static double *exponential_upper_bounds(size_t num, double base, double factor)
   double *exponential_upper_bounds = calloc(num, sizeof(*exponential_upper_bounds));
   exponential_upper_bounds[0] = factor;
   for (size_t i = 1; i + 1 < num; i++)
-    exponential_upper_bounds[i] = exponential_upper_bounds[i - 1] * base;
+    exponential_upper_bounds[i] = factor * pow(base, i); //exponential_upper_bounds[i - 1] * base;
   exponential_upper_bounds[num - 1] = INFINITY;
  return exponential_upper_bounds; 
 }