Options

Converting a number to octal ?

GHOSTRIDER2016GHOSTRIDER2016 Member Posts: 35 ■■□□□□□□□□
Can someone please share with me a simple way of converting a number to octal ? my brain is getting frazzled over these number conversations icon_sad.gif

Thanks

Comments

  • Options
    EANxEANx Member Posts: 1,077 ■■■■■■■■□□
    It's multiplying times 8. The range runs from 0 through 7

    0 = 0
    1 = 1
    7 = 7
    10 = 8
    11 (8+1) = 9
    12 (8+2) = 10
    17 (8+7) = 15
    20 = 16
    30 = 24
    40 = 32
    100 = 64
  • Options
    CryptrotTheWarlockCryptrotTheWarlock Member Posts: 6 ■□□□□□□□□□
    Hey there! I remember you asking about decimal (base10) to binary (base2). The same method can be used for decimal (base10) to octal (baseicon_cool.gif. The poster above gave you octal (base icon_cool.gif to decimal (base 10).

    Anyway we are going to use the same number from your binary (500(base10)) to demonstrate conversion to Octal.

    As a reminder / is integer division, % is modulus which gives you the remainder (which is the octal digit for that position)

    500 / 8 = 62. 500 % 8 = 4 -> 4
    62 / 8 = 7. 62 % 8 = 6 -> 6
    7 / 8 = 0. 7 % 8 = 7 -> 7

    Now we go from the bottom to the top and find that 500(base10) is 764(baseicon_cool.gif.

    The process is the same from base10 to any lower base.
  • Options
    CryptrotTheWarlockCryptrotTheWarlock Member Posts: 6 ■□□□□□□□□□
    I can't edit my post to turn off BB Smilies. (baseicon_cool.gif == ( base8 )
  • Options
    GHOSTRIDER2016GHOSTRIDER2016 Member Posts: 35 ■■□□□□□□□□
    Thankyou :)
    Hey there! I remember you asking about decimal (base10) to binary (base2). The same method can be used for decimal (base10) to octal (baseicon_cool.gif. The poster above gave you octal (base icon_cool.gif to decimal (base 10).

    Anyway we are going to use the same number from your binary (500(base10)) to demonstrate conversion to Octal.

    As a reminder / is integer division, % is modulus which gives you the remainder (which is the octal digit for that position)

    500 / 8 = 62. 500 % 8 = 4 -> 4
    62 / 8 = 7. 62 % 8 = 6 -> 6
    7 / 8 = 0. 7 % 8 = 7 -> 7

    Now we go from the bottom to the top and find that 500(base10) is 764(baseicon_cool.gif.

    The process is the same from base10 to any lower base.
Sign In or Register to comment.