I have read that we can have upto 21 digits in an octal number, not including the leading zero.
Can anyone please tell me the maximum number that can be initialized for a variable in octal representation...
The range is same, don't get confused with octal. 21 digit is the maximum accumulated number an octal number that can be assigned. If you convert the 21 digit octal (the maximum) to decimal, it will come to the same range a long primitive can hold.
int : 32 bits long: 64 bits
(0777777777777777777777) (octal maximum range "21 digits excluding 0") = (0x7FFFFFFFFFFFFFFF) (hexadecimal, maximum) = (1111111111111111111111111111111111111111111111111111111111) (maximum range of 63 bits, a long can hold, excluding sign bit)
Thanks and Regards, cmbhatt
[ April 07, 2007: Message edited by: Chandra Bhatt ] [ April 07, 2007: Message edited by: Chandra Bhatt ]