Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

32bit int largest num!

This topic is 2746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

4 294 967 296 <-- around here should be the largest value able to be stored in a 32 bit int value. What would happen to my program if i stored 5 000 000 000 and then tried to view the value? will it convert my number to exponential form to be able to store it?

Share this post


Link to post
Share on other sites
Advertisement
What happens depends on what language you're using. Python will happily change the type from a regular int to a long int. C++ will generally store the value mod two to the thirty-second.

Share this post


Link to post
Share on other sites
Quote:
Original post by nuclear123
4 294 967 296 <-- around here should be the largest value able to be stored in a 32 bit int value. What would happen to my program if i stored 5 000 000 000 and then tried to view the value? will it convert my number to exponential form to be able to store it?
You can only store that large of a value if your int is unsigned. Otherwise what SiCrane said.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!