所有Arithmatic操作仅使用Bitwise运算符 [英] All Arithmatic operations using Bitwise operators only
本文介绍了所有Arithmatic操作仅使用Bitwise运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以仅使用按位运算执行所有算术运算(+, - ,*,/)。请考虑签名的号码。
谢谢。
Is it possible to perform all arithmetic operations (+,-,*,/) using Bitwise operations only. Please consider signed numbers also.
Thank You.
推荐答案
当然。这就是处理器的工作方式。
Of course. That''s how the processor does it.
@weaknessforcats
是的,我有一个加法和减法的方法,如下所示
@weaknessforcats
Yes, I have a method for addition and subtraction given below
展开 | 选择 | Wrap | 行号
我在你的回复中没有看到任何问题。在任何情况下,我都无法提供解决方案,担任导师或为您做研究。
请阅读发布指南。
I don''t see a question in your reply. In any case, I cannot provide solutions, act as a tutor or do research for you.
Please read the posting guidelines.
这篇关于所有Arithmatic操作仅使用Bitwise运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文