user2015064
user2015064

Reputation:

What is the maximum size of an integer (x86)?

I'm going to upgrade my VC++ 2008 into VC++ 2010 or 2012. Before upgrading I have some questions:

Upvotes: 1

Views: 2526

Answers (2)

user2384250
user2384250

Reputation: 558

In the C++ standard there is a dedicated section for what you want, in short there is <limits> and the included methods that are a solution to your problem.

EDIT: I'm assuming that you want some kind of standardize support, otherwise you should simply refer to the online docs for your compiler

Upvotes: 1

David Heffernan
David Heffernan

Reputation: 612964

For all of the compilers that you mention, 64 bit integer types exist for both 32 and 64 bit targets. However, there are no 128 bit integer types. So, _INTEGRAL_MAX_BITS evaluates to 64 for all of the listed compilers, and for both 32 and 64 bit targets.

The best you can do is probably to use the SSE2 intrinsic __m128i but that depends on the presence of an SSE2 unit on the processor. But you don't need to upgrade to be able to use that. It's available in VS2008 also.

Upvotes: 1

Related Questions