bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] undesired behavior of gsl_stats_sd


From: Ming Ji
Subject: [Bug-gsl] undesired behavior of gsl_stats_sd
Date: Wed, 24 Apr 2013 11:23:15 -0500

Hi,

The output of the following test code is nan. I don't think this is the
desired behavior for users. When number of input data is 1, I think it is
more reasonable to say standard deviation is 0 instead of nan.

thanks,
Ming

#include <iostream>
#include <gsl/gsl_statistics.h>

itn main()
{
    double data[1] = {1.0};
    double sd = gsl_stats_sd(data, 1, 1);
    std::cout << sd << std::endl;
    return 0;
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]