This might be too little information… but why is this working opposite as I expect?
if (indSTime[t] <= monthTotal) {
Log.d("indSTime", String.valueOf(indSTime[t++]));
Log.d("monthTotal", String.valueOf(monthTotal));
NewRate = Double.valueOf(indSRate[s]);
indApr[o] = NewRate;
}
It is working as Greater than or equal to. NOT Less than or equal to the Month total.
I have the “indSTime” set to 4. So Logcat in Eclipse starts logging the two variables like this.
4, 4
4, 5
4, 6
4, 7
etc…
it seems it should be
4 ,1
4, 2
4, 3
4, 4
and STOP.
I know I didn’t add much code above? is there something right in front of me that I am missing? Or what can cause this?
It’s logging entirely reasonable things. Look at your pairings:
Actual:
Expected:
In all of the actual cases,
indSTimeis less than or equal tomonthTotal, exactly as your code suggests.In your expected output, you’ve shown three cases where
indSTimeis greater thanmonthTotal.So, either you actually wanted the opposite operator, or you’ve been confused by your logging, or possibly both. Unfortunately as you haven’t shown any context here, it’s impossible to say exactly where the problem is – but it’s definitely not Java itself.