Bins

closed account (zbREy60M)
Hello! I'm making a program that creates stars called "gravitars" and calculates their slowing frequency over a number of years. All of that is done!

The problem now:

I need to divide the frequencies into equally spaced bins into logarithm (base 10). Then, for each of my fake gravitars, work out which bin it lands in and add to that bin the value of h. At the end of this process, I will have a list of frequency values for each bin, and the sum of all the "h" values for that bin.

Where 'h' is a variable dependent on the frequency.

How do I even go about doing something like this? I've tried "grouping" the gravitars together. I'm quite new at C++ and need a point in the right direction.
Topic archived. No new replies allowed.