Solved

# the range of a unsigned 32-bit integer?

Posted on 2001-08-28
614 Views
is the range of a unsigned 32-bit integer from 0 to 2^31-1 ?
0
Question by:Trou

LVL 4

Accepted Solution

IainHere earned 50 total points
ID: 6431500
2^32-1 if unsigned
0

LVL 32

Expert Comment

ID: 6431777
Isn't this one of those implementation defined constants?
0

Expert Comment

ID: 6431790
It's 0..4294967295
0

Expert Comment

ID: 6431797
So no, it is not.

The range is 2^32-1.
0

Expert Comment

ID: 6431855
Fearum, you have been here long enough to know not to block or lock questions.   You may be right, but that is up to the User to decide, if he/she  uses you comment as an answer, then good for you.

I must reject the proposed answer and return it to the active question listin.

Thanks,
ComTech
Community Suppport
0

LVL 32

Expert Comment

ID: 6431862
Even it the answer Fearum gave is right, IT'S EXACTLY WHAT IanHere posted several hours ago.
0

LVL 4

Expert Comment

ID: 6432153
yes.

To find out programmatically you can use:

#include <limits>
main
{
cout << "limit of unisgned int" << std::numeric_limits<unsigned int>::max();
};
0

Author Comment

ID: 6432245
I found it out from one book.But in my opinion  the range  is 0-2^32-1,or 0-0ffffffffh.

0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.