# Range of Octals

Richa Sharma

Ranch Hand

Posts: 47

posted 6 years ago

Java dosen't support unsigned int types !

This is the range for 32 bit int

–2,147,483,648 to 2,147,483,647

So you can see, the maximum int type is 2,147,483,647(decimal) and convert it into Octal

- 0

Richa Sharma wrote:

Is it the same as 32 bit integers unsigned?

Java dosen't support unsigned int types !

Richa Sharma wrote:

What is the max numbers i can store as octal.

This is the range for 32 bit int

–2,147,483,648 to 2,147,483,647

So you can see, the maximum int type is 2,147,483,647(decimal) and convert it into Octal

posted 6 years ago

- 0

Octal is not a data type - it is just a different way to write down numbers, just like decimal and hexadecimal.

Data types have a range, for 32-bit integers the range is -2^31 to 2^31 - 1, which is:

-2147483648 to 2147483647 (decimal)

-020000000000 to 017777777777 (octal)

-0x80000000 to 0x7FFFFFFF (hexadecimal)

Data types have a range, for 32-bit integers the range is -2^31 to 2^31 - 1, which is:

-2147483648 to 2147483647 (decimal)

-020000000000 to 017777777777 (octal)

-0x80000000 to 0x7FFFFFFF (hexadecimal)

Sanjay Singhaniya

Greenhorn

Posts: 25

posted 6 years ago

Interestingly, these two assignments are actually legal in java...

This is because octal (and hex) were historically used for bit masks -- that Java allows you to actually assign all the bits, including the negative bit, as if it was an unsigned number.

Henry

- 0

Interestingly, these two assignments are actually legal in java...

This is because octal (and hex) were historically used for bit masks -- that Java allows you to actually assign all the bits, including the negative bit, as if it was an unsigned number.

Henry