Skip to content

Comments

Added median to std.algorithm#3680

Closed
JackStouffer wants to merge 1 commit intodlang:masterfrom
JackStouffer:median
Closed

Added median to std.algorithm#3680
JackStouffer wants to merge 1 commit intodlang:masterfrom
JackStouffer:median

Conversation

@JackStouffer
Copy link
Contributor

Split from #3592

I will propose the same question I had in the other PR

I also want to add various other statistical methods to Phobos, such as standard deviation, which fit in std.algorithm, and things such as rolling mean, which don't fit into std.algorithm. I was thinking that something like a rolling mean would best fit in std.numeric, but, would it be best if all of the statistical methods were in the same module, or is it ok to have them separate?

@9il
Copy link
Member

9il commented Oct 2, 2015

Ditto - #3679 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/mean/median/

@DmitryOlshansky
Copy link
Member

Otherwise looks good to me. One thing though - a range may not be sorted but you may have called nth_element algorithm placing r.length/2 element in its place while leaving the rest unsorted.

This way one may have median of a range w/o sorting it.

@JackStouffer
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants