In what situations is octal base used?

后端 未结 9 949
情话喂你
情话喂你 2020-12-01 17:35

I\'ve seen binary and hex used quite often but never octal. Yet octal has it\'s own convention for being used in some languages (ie, a leading 0 indicating octal base). When

相关标签:
9条回答
  • 2020-12-01 18:13

    FYI, there are a few places that windows and javascript automatically decide that a number prefixed with a zero is octal and convert the number.

    In windows if you ping and address like 10.0.2.010 it will actually ping 10.0.2.8

    Windows also does this if you enter it as the ip/dns address for the computer

    Though it is deprecated, Javascript does this by default on some functions like parseInt if you do not specify a radix http://www.w3schools.com/jsref/jsref_parseint.asp

    0 讨论(0)
  • 2020-12-01 18:17

    Octal is used when the number of bits in one word is a multiple of 3. Examples are ancient systems with 18bit word sizes, systems with 9bit bytes, or unix file permissions with 9bits or 12bits.

    If the number of bits in your word is a multiple of 4, however, please do use hex, by all means.

    0 讨论(0)
  • 2020-12-01 18:17

    Didn't think of this but Digital displays!

    Several other uses from: http://en.wikipedia.org/wiki/Octal

    0 讨论(0)
  • 2020-12-01 18:17

    In avionics, ARINC 429 word labels are almost always expressed in octal.

    0 讨论(0)
  • 2020-12-01 18:21

    If birds could count, my guess would be that they use octal. While most birds have 3 digits on their feathered "hands", most are Tetradactyly, meaning 4 toes on each foot.

    0 讨论(0)
  • 2020-12-01 18:30

    Octal is used as a shorthand for representing file permissions on UNIX systems. For example, file mode rwxr-xr-x would be 0755.

    0 讨论(0)
提交回复
热议问题