Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7995215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:20:40+00:00 2026-06-04T14:20:40+00:00

This might be too little information… but why is this working opposite as I

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:20:41+00:00Added an answer on June 4, 2026 at 2:20 pm

    It’s logging entirely reasonable things. Look at your pairings:

    Actual:

    indSTime=4, monthTotal=4
    indSTime=4, monthTotal=5
    indSTime=4, monthTotal=6
    indSTime=4, monthTotal=7
    

    Expected:

    indSTime=4, monthTotal=1
    indSTime=4, monthTotal=2
    indSTime=4, monthTotal=3
    indSTime=4, monthTotal=4
    

    In all of the actual cases, indSTime is less than or equal to monthTotal, exactly as your code suggests.

    In your expected output, you’ve shown three cases where indSTime is greater than monthTotal.

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be pushing things a little too far, but mostly out of curiosity..
I am afraid that this question might be a little too broad, but I
I might be insane to write this here, but I am just too scared
maybe this question is a little too general but maybe someone has experience the
This might be a way too generic question, but what is the general approach
This might be a too bigger ask, but before I outsource it, I would
All, Apologies in advance - this question might be too open-ended for SO. Anyway...
This might seem like a very easy question for some of you folks, but
This might be a simple question but I've searched and searched and can't find
This might be a very basic question but it confuses me. Can two different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.