Have an array of Pressures (hundreds) initialized like this:
class Pressure
{
public double Low;
public double Hi;
};
Pressure[] PressuresA = new[] {
new Pressure { Low=10.5, Hi=16.5 },
new Pressure { Low=11.2, Hi=11.4 },
new Pressure { Low=10.3, Hi=17.5 }
};
Pressure[] PressuresB = new[] {
new Pressure { Low=10.5, Hi=16.5 },
new Pressure { Low=8.1, Hi=10.4 },
new Pressure { Low=10.8, Hi=11.3 }
};
Looking for a function that return a Pressure object with a Low/High as the overlapping values of all elements in the array. If at least one element is outside the overlapping range, the returning Low/High must be 0/0.
The above PressureA must return 11.2,11.4
The above PressureB must return 0,0
Any suggestions?
Thanks
Danny