getPositive, given an array of doubles, returns a positive number. The boolean flag “firstToLast” controls whether to search the array for first to last or from last to first.
getPositive(double[] operands, boolean firstToLast)