Skip to content

[BUG] List.median does not return the same thing as Seq.median and Array.median #184

@nhirschey

Description

@nhirschey

Describe the bug
List.median returns a tuple of two numbers whose average is the median, whereas Seq.median and Array.median return the medians. Should these all produce the same result?

To Reproduce

#r "nuget: FSharp.Stats,0.4.3"

open FSharp.Stats

[|1.0; 2.0 |] |> Array.median // 1.5
seq [ 1.0; 2.0] |> Seq.median // 1.5
[ 1.0; 2.0] |> List.median // (1.0, 2.0)

Expected behavior
I expect the same result for these collections.

OS and framework information (please complete the following information):

  • OS: Windows 11
  • .Net core SDK version 6.0.200

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions