将十进制转化为八进制的算法_十进制系统转换为八进制系统

将十进制转化为八进制的算法

Converting a number from Decimal to Octal is almost similar to converting Decimal into Binary, although just one difference is that unlike Binary conversion, here in an integral part, we successively divide the number by 8 until the quotient is 0 (the last remainder becomes the MSB). The remainders read from bottom to top give the equivalent octal integer number. and in the fractional part, we multiply it by 8 till the fractional part of the product is 0. The first integer in the product term gives the MSB, thus the integers read from top to bottom gives the equivalent octal fraction.

将数字从十进制转换为八进制几乎类似于将十进制转换为二进制 ,尽管唯一的区别是与二进制转换不同,在整数部分中,我们将数字连续除以8直到商为0(最后的余数变为MSB)。 从下到上读取的余数给出等效的八进制整数。 在小数部分中,我们将其乘以8,直到乘积的小数部分为0。乘积项中的第一个整数给出MSB,因此从上到下读取的整数给出等效的八进制小数。

Same as in decimal to binary conversion, to convert a mixed decimal number into octal, we first separate the integral and the fractional part and then convert them into octal individually, after converting both to octal separately, we combine them back together to get the desired result.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值