On Tue, 16 Dec 2014 10:17:19 +0000, Richard Heathfield wrote:
>Rosario193 wrote:
>> On Tue, 16 Dec 2014 05:07:58 +0000, Nobody wrote:
>>
>>>The following code attempts to implement the four basic arithmetic
>>>operations (+,-,*,/) for signed integers, avoiding any undefined
>>>behaviour.
>>
>> why so long routines?
>
>So that he won't have to write them in the assembly of each cpu the code has
>to be ported.
in language operator +,-,*,/ are the most critical one [these
operations one has to use always in the language and programs]
so if these operation has to be use hevly:
the priority is do it the most fast one can obtain
>> if i would be i... write them in the assembly of each cpu the code has
>> to be ported
>
>Remember to put an elephant in Cairo, or you'll wear out your trouser-knees.
if the OP is as u, don't like to see assembly...
the way is easy: write them in C less operation possible
means
break all cpu in sets, that has the same UBs
and write the C code for each set of CPU in C
for example all the cpu that are 1 complement or 2 complement or cpu
has the same UB in the border of [-intmax... intmax] etc and for each
write the C code
but this speach would be not i to write