如何使用大脑将十六进制转换为十进制? [英] How to turn hexadecimal into decimal using brain?
问题描述
打开计算器来做这么小的事情对我来说似乎很烦人,我坚信这样说:您知道的越多越好!"所以在这里我问你如何将十六进制转换为十进制.
Opening the calculator to do such tiny stuff appears annoying to me ,and I strongly believe in ths saying "the more you know,the better!" so here I am asking you how to convert hexadecimal to decimal.
直到那一刻,我使用以下公式:
Till that moment I use the following formula:
Hex: Decimal:
12 12+6
22 22+2*6
34 34+3*6
49 49+4*6
99 99+9*6
以更高的数字(例如C0或FB)前进时,我会感到困惑
I get confused when I move on at higher numbers like C0 or FB
您正在使用的公式(大脑,不是函数)是什么?
What is the formula(brain,not functional) that you're using?
推荐答案
如果您认为十六进制为16,则实际上很简单:
If you consider that hexadecimal is base 16, its actually quite easy:
从最低有效数字开始,朝最高有效数字(从右到左)工作,然后将数字乘以16的幂,然后将结果相加.
Start from the least significant digit and work towards the most significant (right to left) and multiply the digit with increasing powers of 16, then sum the result.
例如:
0x12 = 2 +(1 * 16) = 18
0x12 = 2 + (1 * 16) = 18
0x99 = 9 +(9 * 16) = 153
0x99 = 9 + (9 * 16) = 153
然后,请记住A = 10,B = 11,C = 12,D = 13,E = 14和F = 15
Then, remember that A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15
所以
0xFB = 11 +(15 * 16) = 251
0xFB = 11 + (15 * 16) = 251
这篇关于如何使用大脑将十六进制转换为十进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!