}
if (max_moment >= MOMENT_KURTOSIS && kurtosis != NULL && w > 3.)
{
- double g2 = ((w * (w + 1.) * d4
- - 3. * pow2 (d2) * (w - 1.))
- / ((w - 1.) * (w - 2.) * (w - 3.) * pow2 (s2)));
+ double den = (w - 2.) * (w - 3.) * pow2 (s2);
+ double g2 = (w * (w + 1) * d4 / (w - 1.) / den
+ - 3. * pow2 (d2) / den);
if (finite (g2))
*kurtosis = g2;
}
*values = NULL;
*weights = NULL;
*cnt = 0;
- while (token == T_NUM)
+ while (lex_is_number ())
{
double value = tokval;
double weight = 1.;
lex_get ();
if (lex_match ('*'))
{
- if (token != T_NUM)
+ if (!lex_is_number ())
{
lex_error (_("expecting weight value"));
return 0;