Jump to content
  • Advertisement
Sign in to follow this  
sriniatig

How to increase the 32 bit range ?

This topic is 4870 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

Hi I have a 32 bit fixed point datatype. I was thinking if I want to create a huge world using fixed point 32 bit variables, I would soon run out of range. I thought of a possibility to make the 32 bit datatype to act as a 64 bit datatype and write a routine to emulate it. As I'm using only fixed point I do not have the luxury to use the infinite floating range. My minimal value is 1. Can I get suggessions on how to tacke this issue ? Has someone faced such a problem?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster

Most C++ compilers, including Visual Studio, support 64bit integers, even if you compile for 32bit processors.

if you want to use 64 bit integers, define them as __int64

char x;
long z;
__int64 w;

if the processor does not support 64 bit registers natively, the compiler will generate the code to emulate it, beware that this is much slower, as every operation with 64 bit variables will require several CPU cycles.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
actually you can use the more standard
LONGLONG and must compiler will converted to the apropriated 64 bit type either nativally or by emulation.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!