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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:32:26+00:00 2026-06-16T18:32:26+00:00

Possible Duplicate: The importance of using a 16bit integer If today’s processors perform (under

  • 0

Possible Duplicate:
The importance of using a 16bit integer

If today’s processors perform (under standard conditions) 32-bit operations — then is using a “short int” reasonable? Because in order to perform an operation on that data, it will convert it to a 32-bit (from 16-bit) integer, perform the operations, and then go back to 16-bit — I think. So what is the point?

In essence my questions are as follows:

  1. What (if any) performance gain/hindrance does using a smaller ranged integer bring? Like, if instead of using a standard 32-bit integer for storage, I use a 16-bit short integer.
  2. “and then go back to 16-bit” — Am I correct here? See above.
  3. Are all integer data stored as 32-bit integer space on CPU/RAM?
  • 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-16T18:32:27+00:00Added an answer on June 16, 2026 at 6:32 pm
    1. The processor doesn’t need to “expand” a value to work with it. It just pads the unused spaces with zeroes and ignores them when performing calculations. So, actually, it is faster to operate on a short int than a long int, although with today’s fast CPUs it is very hard to notice even a bit of difference (pun intended).

    2. The machine doesn’t really convert. When changing the size of a value, it either pads zeroes to the left or totally ignores extra bits to the left that won’t fit in the target memory region.

    3. No, and this is usually the reason people use short int values for purposes where the range of a long int just isn’t needed. The memory allocated is different for each length of int, like a short int takes up fewer bits of memory than a long int. One of the steps in optimization is to change long int values to short int values when the range does not exceed that of a short int, meaning that the value would never use the extra bits allocated with a long int. The memory saved from such an optimization can actually be quite significant when dealing with a lot of elements in arrays or a lot of objects of the same struct or class.

    Different int sizes are stored with different amounts of bits in both the RAM and the internal processor cache. This is also true of float, double, and long double, although long double is mainly for 64-bit systems and most compilers just ignore the long if running on 32-bit machines because a 64-bit value in a 32-bit accumulator & ALU will be ‘mowed down’ during any calculation and would likely never receive anything but zeros for the first 32 bits.

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

Sidebar

Related Questions

Possible Duplicate: Importance of varchar length in MySQL table When using VARCHAR (assuming this
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: Practical examples of using symbols in Scala? What is the reason of
Possible Duplicate: Unique random numbers in O(1)? Unique random numbers in an integer array
Possible Duplicate: ‘ascii’ codec can’t decode byte (problem when using django) From a Chrome
Possible Duplicate: how to test php email using WAMP Hey everyone, First off I
Possible Duplicate: Why does a class implements Serializable interface? I'm using a tutorial found
Possible Duplicate: How to compare software versions using SQL Server? I am a complete
Possible Duplicate: Fastest serializer and deserializer with lowest memory footprint in C#? I'm using
Possible Duplicate: Environment.TickCount vs DateTime.Now In my application I require fast timing operations but

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.