4 ms·
If you care about efficiency, you have to take computer architecture into account. (One important example is that floating-point numbers are not reals we tend t
by Koshkin 4y ago
If you care about efficiency, you have to take computer architecture into account. (One important example is that floating-point numbers are not reals we tend to think of them as.)
- Kranar 4y agoThe example provided has nothing to do with computer architecture or efficiency. In fact if anything it's less efficient than what most computer architectures provide natively. I'm questioning OP because I have strong doubts that he actually understands C's integer promotion rules that he can claim that it's basic stuff. They are very subtle and even C and C++ experts get bitten by them.
- Koshkin 4y agoThe usual computer architecture includes the representation of floating-point numbers that is a very efficient (albeit imprecise) model of the reals.
- Kranar 4y agoThe example has nothing to do with floating points not to mention most computer architectures do not have floating point units.