def sd
      return 0.0 if num < 2

      # (sqrt( ((s).sumsq - ( (s).sum * (s).sum / (s).num)) / ((s).num-1) ))
      begin
        return Math.sqrt( (sumsq - ( sum * sum / num)) / (num-1) )
      rescue Errno::EDOM
        return 0.0
      end
    end
def sd
      return 0.0 if num < 2

      # (sqrt( ((s).sumsq - ( (s).sum * (s).sum / (s).num)) / ((s).num-1) ))
      begin
        return Math.sqrt( (sumsq - ( sum * sum / num)) / (num-1) )
      rescue Errno::EDOM
        return 0.0
      end
    end
Calculates the standard deviation of the data so far.