X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Ftrimmed-mean.c;h=2d44d0dc08cc3bba114f4ed9004c17eaf9ae6a7f;hb=2c6814f86fdade89b4b615b0d5b7c6c9c8d1bc1a;hp=5e48689626817ddf59ad46363a17e1d0e763084d;hpb=81579d9e9f994fb2908f50af41c3eb033d216e58;p=pspp diff --git a/src/math/trimmed-mean.c b/src/math/trimmed-mean.c index 5e48689626..2d44d0dc08 100644 --- a/src/math/trimmed-mean.c +++ b/src/math/trimmed-mean.c @@ -57,7 +57,7 @@ trimmed_mean_create (double W, double tail) struct statistic *stat = &os->parent; os->n_k = 2; - os->k = xcalloc (sizeof (*os->k), 2); + os->k = xcalloc (2, sizeof (*os->k)); assert (tail >= 0); assert (tail <= 1); @@ -81,8 +81,6 @@ trimmed_mean_calculate (const struct trimmed_mean *tm) { const struct order_stats *os = (const struct order_stats *) tm; - assert (os->cc == tm->w); - return ( (os->k[0].cc_p1 - os->k[0].tc) * os->k[0].y_p1