Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

octal number

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
octal number can have upto 21 digits. How? I didnt understand....
000 to 377 is the range right? and the maximum digit for integer
is 2137483467, that is 10 digits... then how come octal can have upto
21 digits.

Please do reply for my answer...
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Binary can have 2 digits: zero and one
Octal can have up to 8 digits in each position. (0 - 7)
Decimal can have up to 10 digits in each position. (1 - 9)
Hexadecimal can have up to 16 digits in each position. (0 - F)

The maximum size for an int (in decimal form) is about 2 million. In hexadecimal that would be 7FFFFFFF. However a max long in hexadecimal would be 7FFFFFFFFFFFFFFF.

In other words, an octal number can be created that is infinitely long. However if you're talking about how many octal digits there could possibly be in an int, that's a different question. Can you clarify what you mean by "000 to 377 is the range right?" The range of what?
[ February 09, 2006: Message edited by: Marilyn de Queiroz ]
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic