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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:35:04+00:00 2026-05-27T09:35:04+00:00

I was looking into 32-bit and 64-bit. I noticed that the range of integer

  • 0

I was looking into 32-bit and 64-bit. I noticed that the range of integer values that can stored in 32 bits is ±4,294,967,295 but the Java int is also 32-bit (If I am not mistaken) and it stores values up to ±2 147 483 648. Same thing for long, it stores values from 0 to ±2^63 but 64-bit stores ±2^64 values. How come these values are different?

  • 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-27T09:35:04+00:00Added an answer on May 27, 2026 at 9:35 am

    Integers in Java are signed, so one bit is reserved to represent whether the number is positive or negative. The representation is called “two’s complement notation.” With this approach, the maximum positive value represented by n bits is given by

    (2 ^ (n – 1)) – 1

    and the corresponding minimum negative value is given by

    -(2 ^ (n – 1))

    The “off-by-one” aspect to the positive and negative bounds is due to zero. Zero takes up a slot, leaving an even number of negative numbers and an odd number of positive numbers. If you picture the represented values as marks on a circle—like hours on a clock face—you’ll see that zero belongs more to the positive range than the negative range. In other words, if you count zero as sort of positive, you’ll find more symmetry in the positive and negative value ranges.

    To learn this representation, start small. Take, say, three bits and write out all the numbers that can be represented:

    • 0
    • 1
    • 2
    • 3
    • -4
    • -3
    • -2
    • -1

    Can you write the three-bit sequence that defines each of those numbers? Once you understand how to do that, try it with one more bit. From there, you imagine how it extends up to 32 or 64 bits.

    That sequence forms a “wheel,” where each is formed by adding one to the previous, with noted wraparound from 3 to -4. That wraparound effect (which can also occur with subtraction) is called “modulo arithemetic.”

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

Sidebar

Related Questions

By looking into the Open JPA website i've found that i can log the
I'm looking into how I can get values from specific XML nodes in an
I'm looking a bit into Hudson, and can't seem to find the option to
I looking into making a kind of robot testing browser. Like Selenium, but one
I've been looking into SQL recently and exploring a bit. in regards to Temp
I'v been looking into using DLR for my toy language, and I'm a bit
I have been looking into different types of timers that i could use for
I was recently looking into internals of CancellationToken structure and discovered a bit of
I've recently been doing a bit of work with Rails Engines, specifically looking into
I'm currently looking into possible ways we can refactor our codebase, to make it

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.