Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

UeberBobo

overflow

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

what can i do when unsigned long int is not enough and i need to store numbers bigger than that (2^32 right?) thanks

Share this post


Link to post
Share on other sites
Advertisement
Use __int64 if you are using a VC compiler. It holds 2^64 bits.
Some compilers support long long int, which is also 64 bits wide.

[edited by - biovenger on April 10, 2004 7:09:41 AM]

Share this post


Link to post
Share on other sites
All compilers support long long int, but on a lot of architectures it won''t be 64 bits.

Ueber, a floating point number can store much larger numbers than an integer. Of course, very large numbers will not be precise.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
_int64 under MS VC

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/large_integer_functions.asp

These functions may help as 64 bit ints are made up of two 32 bit vars jammed together. I''m under the impression they are a real pain to use and slow too due to 32 bit cpu''s having to decode and encode them all the time. I''d try to give them a miss for a game if at all possible.

Jay

Share this post


Link to post
Share on other sites
quote:
Original post by Sneftel
All compilers support long long int, but on a lot of architectures it won''t be 64 bits.
...


Sorry for not being clear, that was what I meant. After all, he wanted more than 32 bits integer precision. Thanks for clearing that one out.

Easiest way to check if your compiler has 64 bit long long ints is to just make a simple std::cout << sizeof(long long int); and see what happens. If you get 8, your compiler compiles lli''s as 64 bits.

Share this post


Link to post
Share on other sites

  • 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!