JasonBock / SpackleNet

Spackle is a project that contains a number of helper methods I've used to supplement the core classes in .NET.
MIT License
14 stars 1 forks source link

Partitions Results Don't Seem "Fair" #25

Closed JasonBock closed 4 years ago

JasonBock commented 4 years ago

If I run this code:

var range = 1..50000;
var partitions = range.Partition(7);
Console.Out.WriteLine(partitions.Length);

foreach(var partition in partitions)
{
    Console.Out.WriteLine($"{partition}\t\t{partition.End.Value - partition.Start.Value}");
}

I get this:

1..7148         7147
7149..14290             7141
14291..21432            7141
21433..28574            7141
28575..35716            7141
35717..42858            7141
42859..50000            7141

The results should be closer to each other than what they are.