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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:25:10+00:00 2026-06-02T05:25:10+00:00

I had an interesting problem today. As part of practice with my fluency with

  • 0

I had an interesting problem today. As part of practice with my fluency with objective-c, as I sit in math class, I write programs for each problem done on the board in hopes to increase my math and programming capabilities.

However, today I encountered a problem. One of the questions was something like “Find the greatest prime number that 10564245 (<– example number) is divisible by”

So, I went in and made the program. I got as far as doing the loop for values to check, and then began to code the part where it checks the reminder, and if it’s 0, it logs it, and if it isn’t, it skips it.

However, since the number is too big to be an int, it had to be a double. When I tried to plug the number in, the program gave me errors when I wanted to use the % operator with the double. Is there any way to find remainders if you have a very large number?

Thanks

ERROR: Invalid operands to binary expression

EDIT: SOLVED!

I took a little from each answer. We have the fmod capability, but I ended up using long instead of int, I don’t know why I didn’t think of the origionally

  • 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-02T05:25:12+00:00Added an answer on June 2, 2026 at 5:25 am

    Double values aren’t precise for integer values and so probably shouldn’t be used for this sort of thing. Instead, you can use a long into or even a long long int to do your calculations

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

Sidebar

Related Questions

We had a very interesting problem with a Win Forms project. It's been resolved.
So, here's an interesting little problem I've had to deal with. I coded a
Here's something interesting, turnsout that many people out there had this problem, but i
While developing a mobile PhoneGap app I had an interesting problem. I needed to
I had an interesting request from a client today and I'm not exactly sure
I just had an interesting experience with a startup form in MS Access 2010.
We've had an interesting request from a client. They'd like their users to have
Had a problem with the recursive conflictCheck() method. That seems fine now. I have
Had this working; at one stage. The problem is the following text is now
I've got a wonderfully fun little SQL problem to solve today and thought I'd

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.