I guess this would be more maths than C#. I've got an array of float values, where most values belong to one of the few tightly packed ranges. Here's an example (Lower Limit=0,Upper Limit=612):
3.4,5.0,6.1,
144.0,144.14,145.0,147.0,
273.77,275.19,279.0,
399.4,399.91,401.45,
533.26,537.0,538.9
This is a single array of 16 values, just separated them to show those "groups". What I need to do is to somehow group them, either using Linq, or a manual loop or whatever, so that those close values fall in a single group.
A simple math operation like dividing by 10 (or 100) won't work, because 399 would fall in a different group than 401 (4th group in the above example). Another approach would be to create a histogram of some kind, but I'm looking for something simple here. Any help would be greatly appreciated.