计算机数学
我无法弄清楚十六进制之间的数字序列 288 和 2AO 我真的需要帮助。
I can not figure out the sequence of numbers between hexadecimal
288 and 2AO i really need help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能想知道,即使 Windows
calc.exe
也提供了十六进制模式,并且 Google 本身就可以做到:)You might want to know that even Windows
calc.exe
provides a HEX mode and that Google itself can do it :)阅读此,了解有关 16 进制数字系统的信息
十进制:
十六进制:
Read this for info on base-16 numeral system
Decimal:
Hex:
让我们从更简单的事情开始。按照您习惯的方式,以 10 为基数,32 到 45 之间的数字顺序是什么?
32 之后是 33, 34, 35... 39。然后,由于以 10 为基数的数字在 0 到 9 之间,因此前进到 40。最右边的数字回绕到 0,而其左边的数字变为一个更大,因此给你 40。从那里你继续 - 41,42,43,44,45。
现在,在其他基础上,这只是数字数量不同的问题。让我们考虑同样的问题 (32->45),但以 6 为基数。6 基数有六位数字 - 0,1,2,3,4,5。所以你从 32 到 33、34、35,在这里,就像你从 39 跳到 40 一样,你停了下来。 6 进制中没有 36 - 你从 5 到 0,然后增加左边的数字 - 因此是 40。从那里开始是 41,42,43,44,45。
现在,对于小于 10 的基数(如上面的 6 基数),这很容易 - 数字更少。但是 11 进制呢?基数 64?或者你的情况是 16 进制?你会如何表示第十一个数字?
在这里,约定很简单。数字变成字母。这些是基数 16(十六进制基数)的数字:
0 1 2 3 4 5 6 7 8 9 ABCDEF
所以第十一位数字是 A。第十六位数字是 F。让我们回到我的第一个示例,但以十六进制基数进行操作。您从 32 开始。转到 33、34...39,然后在 30 秒内继续执行 3A、3B、3C、3D、3E、3F,在这里您回绕到 0 - 并跳转到 40。这是完整的序列:
32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F,40,41,42,43,44,45
从这里你应该能够自己解决288-2A0。
祝你好运!
Let's start with something simpler. What's the sequence of numbers between 32 and 45, in the 10 base, as you're used to?
After 32, there's 33, 34, 35... 39. And then, since the digits in base-10 are between 0 and 9, you advance to 40. The rightmost digit wraps back to 0, and the digit on its left becomes one bigger, thus giving you 40. From there you continue - 41,42,43,44,45.
Now, in other bases, its simply a matter of a different amount of digits. Let's take the same question (32->45), but in base 6. Base 6 has six digits - 0,1,2,3,4,5. So you go from 32 to 33, 34, 35, and here, just like you jumped from 39 to 40, you stop. There is no 36 in base 6 - you go from 5 to 0, and then you increment the left digit - hence 40. From there it's 41,42,43,44,45.
Now, with bases which are less than 10 (like base 6 above), it's easy - there are less digits. But what about base 11? base 64? or in your case, base 16? How would you represent the eleventh digit?
Here, the convention is simple. The digits turn into letters. These are the digits for base 16, the hexadecimal base:
0 1 2 3 4 5 6 7 8 9 A B C D E F
So the eleventh digit is A. The sixteenth digit is F. Let's go back to my first example but do it in the hexadecimal base. You start with 32. Go to 33, 34... 39, and then you proceed within the 30s with 3A, 3B, 3C, 3D, 3E, 3F, and here you wrap back to 0 - and jump to 40. Here is the complete sequence:
32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F,40,41,42,43,44,45
From here you should be able to solve 288-2A0 by yourself.
Good luck!
此 C 程序将输出以下值:
输出: 288 289 28A 28B 28C 28D 28E 28F 290 291 292 293 294 295 296 297 298 299 29A 29B 29C 29D 29E 29F 2A0
这是您想要的吗?
This C program will output the values:
Output: 288 289 28A 28B 28C 28D 28E 28F 290 291 292 293 294 295 296 297 298 299 29A 29B 29C 29D 29E 29F 2A0
Is this what you want?