unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: master 792ba71: Add a new function 'buffer-line-statistics'
Date: Tue, 12 Jan 2021 13:15:25 -0500	[thread overview]
Message-ID: <jwveeiq2ffk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20210112174750.5928220B2C@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Tue, 12 Jan 2021 12:47:49 -0500 (EST)")

> +  double mean = 0;
[...]
> +	  /* Blame Knuth. */
> +	  mean = mean + (this_line - mean) / lines;

I must admit to not being fully cognizant of Knuth, but doesn't this
compute the average rather than the mean?

I thought computing the mean was necessarily O(N) in space (like
keeping the full sequence of line lengths so you can sort it and then
pick the middle point).


        Stefan




       reply	other threads:[~2021-01-12 18:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210112174748.18372.29339@vcs0.savannah.gnu.org>
     [not found] ` <20210112174750.5928220B2C@vcs0.savannah.gnu.org>
2021-01-12 18:15   ` Stefan Monnier [this message]
2021-01-12 18:29     ` master 792ba71: Add a new function 'buffer-line-statistics' Philipp Stephani
2021-01-12 19:06       ` Stefan Monnier
2021-01-12 18:37     ` Eli Zaretskii
2021-01-12 18:43       ` Eli Zaretskii
2021-01-12 18:39     ` Lars Ingebrigtsen
2021-01-12 19:18       ` Eli Zaretskii
2021-01-12 19:54         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwveeiq2ffk.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).