Converting Numbers

Decimal to Octal

Decimal to Octal

To convert a decimal number to an octal number:

1.Divide the decimal number by 8. The remainder of this first division becomes the least significant (rightmost) digit of the octal value.

2.Divide the quotient from Step 1 by 8, and use the remainder of the next division as the next digit (to the left) of the octal value. Continue to divide the quotients by 8 until the decimal number is exhausted. The remainder from the last division is the most significant (leftmost) digit of the octal value.

Example

Convert the decimal value 358 to its octal equivalent. (In this example, the symbol “/” indicates division.)

Step

Division

 

Quotient

Remainder

1.

358/8

=

44

6

2.

44/8

=

5

4

3.

5/8

=

0

5

remainder = least significant (rightmost) digit

remainder = most significant (leftmost) digit

The result is:

Decimal Value Octal Value

358%546

HP Integrity NonStop NS-Series Operations Guide529869-005

D-8

Page 250
Image 250
HP NonStop NS manual Decimal to Octal, Step Division Quotient, Decimal Value Octal Value