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

  • Home
  • SEARCH
  • 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 5931537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:42:31+00:00 2026-05-22T14:42:31+00:00

I have to do some logic based on the following implementation. I have a

  • 0

I have to do some logic based on the following implementation.

I have a big number upto 36 Digits e.g. 913695089923267549815145223638290430 (randomly generated by different app). I need to divide it by any number smaller in length say 70368844197664;(randomly generated by different app) Suppose i get quotient as 19956694.3256

For my code only last digit of quotient before decimal (i.e. 4) is important. The objective is to check whether the quotient is even or odd and if possible value of last digit too.

I cannot use simple DB functions like modulus or division as it is very time consuming. Is there any faster efficient way? Any suggestions will be highly appreciated.

Thank you so much.

Regards
Neeraj

  • 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-05-22T14:42:32+00:00Added an answer on May 22, 2026 at 2:42 pm

    What you want to do is pretty much the definition of “modulo arithmetic”. If the built-in arithmetic in your database can’t do the calculation fast enough, I’m not sure what you could do to improve that short of writing your own database engine or buying higher-powered hardware.

    Is the problem really the speed of the arithmetic, or is it record retrieval or indexing? I mean, if you’re saying something like:

    select ... whatever ... from table1 join table2 using (someid)
    where (table1.q / table2.d) % 10 = 4
    

    and you don’t have an index on the function (table1.q / table2.d ) % 10, this would require the db to read every record, perform the calculation, and then pick out those that give the right answer. Your problem might not be arithmetic, but indexing.

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

Sidebar

Related Questions

There are some HTML based games (ie bootleggers.us) that have a simple login form
I have some logic, which defines and uses some user-defined types, like these: class
I have some logic in a method that operates on a specified type and
I have some logic that depends upon two properties being set, as it executes
I have some logic in before_save whereby (only) when some conditions are met I
I have some custom logic that needs to be executed every single time a
I am creating a series of UserControls that all have some similar business logic.
I have a LinkButton that has to postback to perform some logic. Once it
I have a HtmlHelper extension method that I would like to apply some logic
I have a library that I created with some business logic that includes writing

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.