Sho Kuwamoto wrote: > So, combining (1.2) and (2.2), the algorithm to compute the > space between block-level elements would be: > > if (a >= 0 && b>= 0) > space = max(a,b); > > else if ( (a >= 0 && b < 0) || (a < 0 && b >= 0) ) > space = a+b; > > else // a < 0 && b < 0 > space = -max(-a,-b); > > Any thoughts? Well, if you're doing it in 32-bit x86 assembler, I think this will do the job quite quickly: mov eax,margin1 mov ebx,margin2 cmp eax,ebx jg greaterax xchg eax,ebx jbe switcheck addem: add eax,ebx jmp done greaterax: jb addem switcheck: or eax,eax jns done xchg eax,ebx done: ; eax now has margin David PerrellReceived on Monday, 21 July 1997 22:28:36 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:50 GMT