Bagaimana cara mengubah desimal ke oktal?
Langkah-langkah perhitungan untuk bagian bilangan bulat:
- Bagilah angka desimal dengan 8.
- Dapatkan hasil bagi bilangan bulat dan gunakan untuk iterasi berikutnya.
- Dapatkan sisanya dan gunakan untuk angka oktal.
- Ulangi langkah di atas hingga hasil bagi sama dengan 0, atau setelah sejumlah langkah tertentu.
Langkah-langkah menghitung bagian pecahan:
- Kalikan bagian pecahan dengan 8.
- Ambil bagian bilangan bulat dari hasil kali sebagai angka pecahan. Ambil bagian pecahan produk untuk iterasi berikutnya.
- Ulangi langkah di atas hingga bagian pecahan menjadi 0, atau berhenti setelah beberapa langkah jika bagian pecahan tidak menjadi 0.
Contoh:
Mengubah 15.062510 ke oktal:
Konversi bagian bilangan bulat:
Dibagi dengan 8 | Hasil bagi | Sisa | Bit |
---|
15/8 | 1 | 7 | 0 |
1/8 | 0 | 1 | 1 |
Konversi bagian pecahan:
Kalikan dengan 8 | Produk | Sisa | Digit Pecahan |
---|
0.0625*8 | 0.5 | 0.5 | 0 |
0.5*8 | 4 | 0 | 4 |
Hasil: 15.062510 = 17.048