Wednesday, 7 August 2013

Check every possible combination of numbers against one

Check every possible combination of numbers against one

I currently load numbers into an array, these are always different numbers
and there can be any amount of them, here is an example;
Array ( [0] => 60.0 [1] => 56.8 [2] => 42.08 [3] => 52.16 [4] => 52.8 )
I am trying to calculate every possible out come of this array, I simply
need to add all numbers together (apart from the key number and its self)
and try to match a figure, for example;
60.0 + 56.8, 60.0 + 42.08, 60.0 + 52.16 etc etc
Then to 56.8 + 60.0, 56.8 + 42.08 etc etc
but not including; 60.0 + 60.0 or another calculations that include themselfs

No comments:

Post a Comment