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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:26:48+00:00 2026-06-15T01:26:48+00:00

This is the code to calculate 1000th power of 2. #include <stdio.h> int main()

  • 0

This is the code to calculate 1000th power of 2.

#include <stdio.h>

int main() {
    double multiply = 1;
    int i;
    for(i = 1; i <= 1000; i++) {
        multiply *= 2;
    }
    printf("%lf\n", multiply);
    return 0;
}

And the output on my system, as well as ideone

10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376

which is exactly the right answer:

irb(main):001:0> 10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376 == 2 ** 1000
=> true
  • 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-15T01:26:49+00:00Added an answer on June 15, 2026 at 1:26 am

    According to IEEE 754, floats etc. are stored in a 2-power format: sign, mantissa and exponent for base 2.

    So 2^1000 is, simply spoken, stored with a mantissa of exactly 1 and an exponent of 1000.

    If you would add 2, the value isn’t correct any longer.

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

Sidebar

Related Questions

I'm using this code to calculate the area of a triangle, with the values
I'm currently using this code to calculate the sunrise / sunset times. (To be
I was given this Python code that would calculate an MD5 value for any
I am using the following code snippet to calculate a total price. This works
i am using the following code(based on this http://goo.gl/5HhSx ) to calculate the difference
I am using this code to calculate the the distance between two points. I
I have this code which calculate route between tow places function createDrivingRoute() { $(#nav).html();//CLEAR
I'm running this code to calculate square root of x[i][j] - y[j] but it
I have this c code, where i need to calculate a dobule from a
I try to calculate a miles per hours. For this I write a code

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.