2 ms·
> What if the architecture doesn't have a carry? Then the compiler has to generate one when needed. What is your point? If you want to do multiple precision ar
by renox 13y ago
> What if the architecture doesn't have a carry? Then the compiler has to generate one when needed.
What is your point?
If you want to do multiple precision arithmetic in assembly, then on the architectures which don't have a carry, you must indeed generate one, so what?
If a language has some operations with carry, then it is up to the programmer to use them only when he needs them..
> C doesn't even mandate what happens in case of an integer overflow
That's for performance reasons, and I would say that it is the wrong default aka 'premature optimisation', a better language would have 'int' with overflow checks (which could be disabled by a compiler switch) and int_raw for the unsafe&fast behaviour.