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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:42:19+00:00 2026-06-13T00:42:19+00:00

Pretty simple question really. I have two uint64 values. I want to divide the

  • 0

Pretty simple question really. I have two uint64 values. I want to divide the two numbers and get the remainder.

 uint64 number1 = 36556800;
 uint64 number2 = 59325441;
 uint64 result = number1 % number2;
 NSLog(@"Result: %lld", result);

The above code always prints the value of number1 (36556800).

EDIT: I realize that number1 is less than number2. When you divide these two numbers the result is a fraction. I want to capture that fraction. So basically in my example:

 36556800 / 59325441 = 0.6162

How do I get 6162 into a variable? Integer division discards the fraction so isn’t the modulus operator what I should be using?

  • 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-13T00:42:20+00:00Added an answer on June 13, 2026 at 12:42 am

    How many times does 59325441 go into 36556800?

    Zero times, because 59325441 is greater than 36556800.

    How much is left when you subtract 0 * 59325441 from 36556800?

    36556800 - 0 * 59325441 == 36556800
    

    Therefore

    36556800 % 59325441 == 36556800
    

    Your code is printing the correct answer. If you expected a different answer, edit your question to include the answer you expected, and explain why you expected it.

    UPDATE

    Based on your revised question, it sounds like you want to convert your numbers to double before you divide:

    double fraction = (double)number1 / (double)number2;
    NSLog(@"fraction = %.4f", fraction);
    

    Note that a double cannot represent all integers larger than 253 exactly.

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

Sidebar

Related Questions

I have a pretty simple question but I am really new to php. I
Pretty simple question. I'm quite certain I have the Class, method, codebehind, etc linked
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
I have a pretty simple question which perhaps someone familiar with Server/Client design &
i have pretty simple simple question (i hope so). How do i change the
hopefully a pretty simple question this time. I have a Select method in a
This is a pretty simple question really, but let's say I'm creating a model
It's a pretty simple question, I always have to go check here and then
The question is pretty simple actually. I have a module in my system containing
This might be a pretty simple question, but if there really is a difference,

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.