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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:22:19+00:00 2026-06-17T01:22:19+00:00

The output for this double multiplication (double)1000000007 * (double)11111111 should end with 7 (or

  • 0

The output for this double multiplication (double)1000000007 * (double)11111111 should end with 7 (or equal to 11111111077777777 be precise). But this piece of code I wrote outputs the result ending with 6 (or equal to 11111111077777776 to be precise). I cannot figure out what I might be doing wrong. Any help would be great.

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
    cout << setprecision(40) << (double)1000000007 * (double)11111111;
}
  • 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-17T01:22:20+00:00Added an answer on June 17, 2026 at 1:22 am

    When you do multiplication with double values, the results are not precise. There is an inherent precision available to double, which, while fairly accurate, is not precise enough to exactly represent your value.

    I recommend reading What Every Computer Scientist Should Know About Floating-Point Arithmetic.

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

Sidebar

Related Questions

I have this code $vad = 1.1; print gettype($vad); var_dump($vad); this will output: double
This is done manually by going to the Error List output window and double-clicking
While answering this question, I got these confusing results: double d = 0.49999999999999990d; //output
This is a double question in terms of front end usability and PHP DATE_TIME
Here's my current code , and here's my current output: This program will calculate
can someone explain to me why the output for this: double y = 15/7;
Input: $string = this-is-just-an--example Output: this is just an-example Tried various things centered around
I have a variable which I get from database I want to output this
Why does this output a 0 byte file? <?php $jsonurl = http://do.convertapi.com/Web2Pdf/json/?curl=http://stackoverflow.com/; $json =
There is this output of objdump on some object file: $ objdump -h main.o

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.