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 8468131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:50:49+00:00 2026-06-10T15:50:49+00:00

now I have one formula: int a = 53, x = 53, length =

  • 0

now I have one formula:

int a = 53, x = 53, length = 62, result;
result = (a + x) % length;

but how to calculate reverse modulus to get the smallest “x” if I known result already

(53 + x) % 62 = 44
//how to get x

i mean what’s the formula or logic to get x

  • 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-10T15:50:51+00:00Added an answer on June 10, 2026 at 3:50 pm
    private int ReverseModulus(int div, int a, int remainder)
    {
       if(remainder >= div)
          throw new ArgumentException("Remainder cannot be greater than or equal to divisor");
       if(a < remainder)
          return remainder - a;
       return div + remainder - a;
    }
    

    e.g. :

    // (53 + x) % 62 = 44
    var res = ReverseModulus(62,53,44); // res = 53
    
    // (2 + x) % 8 = 3
    var res = ReverseModulus(8,2,3); // res = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one variable var1='common_location/specific_location_1/common_filename_text' now I have to get a new variable var2='common_location/specific_location_2/common_filename_text'.
I currently have one iPad app, but it now needs to become two. The
I have one conditional formula which works well. Now, I want to use a
I have one static Semaphore instance. Semaphore semaphore = new Semaphore(1); Now I have
i have one application which is build using VB.NET now i required to add
I have one main outstanding issue, I know now how to databind to lists
I have one function ParseHtmlTable(string htmlContent) . Now in that function I want to
I have one image animation started using GameQuery. Now I want to stop the
I have one mainViewController and I have a UIPickerView. Now all is set up
I have one portal with 3 modules inside it, now my requirement is i

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.