是一个人的补充现实世界的问题,或者只是一个历史吗? [英] Is one's complement a real-world issue, or just a historical one?

查看:183
本文介绍了是一个人的补充现实世界的问题,或者只是一个历史吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

另一个问题问用C确定奇/均匀度和习惯(X安培; 1)办法被正确标记为断供一个人的基础补系统,C标准允许。

Another question asked about determining odd/evenness in C, and the idiomatic (x & 1) approach was correctly flagged as broken for one's complement-based systems, which the C standard allows for.

DO系统确实存在于现实世界计算机博物馆之外吗?自1970年我一直在编码和我pretty确保我从来没有见过这样的野兽。

Do systems really exist in the 'real world' outside of computer museums? I've been coding since the 1970's and I'm pretty sure I've never met such a beast.

时的人真正开发或测试code这样的系统?而且,如果没有,我们应该担心这样的事情,还是应该把它们放进 101室随着纸带穿孔卡片...?

Is anyone actually developing or testing code for such a system? And, if not, should we worry about such things or should we put them into Room 101 along with paper tape and punch cards...?

推荐答案

这一切都归结为知道你的根。

是的,这在技术上是一个古老的技术,我可能会做什么,其他人在这个问题建议和使用模(%)运算符来确定奇数或偶数。
但了解什么是1秒恭维(或2S补)始终知道一件好事。无论你是否曾经使用它们,你的CPU是处理这些事情所有的时间。因此,它可以从来没有伤害理解的概念。现在,现代系统使它所以你一般永远不必担心这样的事情,因此已经成为一种编程101场的话题。但是,你要记住,有些人其实还是会用这个在现实世界...例如,流行的看法相反还有谁的仍然使用汇编!的不是很多,但直到人们的CPU可以理解的原始C#和Java的有人的打算还是要理解这个东西。

This all comes down to knowing your roots.
Yes, this is technically an old technique and I would probably do what other people suggested in that question and use the modulo (%) operator to determine odd or even. But understanding what a 1s compliment (or 2s compliment) is always a good thing to know. Whether or not you ever use them, your CPU is dealing with those things all of the time. So it can never hurt to understand the concept. Now, modern systems make it so you generally never have to worry about things like that so it has become a topic for Programming 101 courses in a way. But you have to remember that some people actually would still use this in the "real world"... for example, contrary to popular belief there are people who still use assembly! Not many, but until CPUs can understand raw C# and Java, someone is going to still have to understand this stuff.

和哎呀,你永远不知道什么时候你会发现你自己做的事情,你确实需要进行二进制数学和1S恭维可以派上用场。

And heck, you never know when you might find your self doing something where you actually need to perform binary math and that 1s compliment could come in handy.

这篇关于是一个人的补充现实世界的问题,或者只是一个历史吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆