1988-04-07 11:40:46 +00:00
|
|
|
/*
|
|
|
|
(c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Header$ */
|
|
|
|
|
1988-04-07 10:57:49 +00:00
|
|
|
/*
|
|
|
|
SHIFT TWO EXTENDED NUMBERS INTO PROPER
|
|
|
|
ALIGNMENT FOR ADDITION (exponents are equal)
|
1988-08-04 11:16:20 +00:00
|
|
|
Numbers should not be zero on entry.
|
1988-04-07 10:57:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "FP_types.h"
|
|
|
|
|
|
|
|
sft_ext(e1,e2)
|
|
|
|
EXTEND *e1,*e2;
|
|
|
|
{
|
|
|
|
register EXTEND *s;
|
1988-07-25 10:46:15 +00:00
|
|
|
register int diff;
|
1988-04-07 10:57:49 +00:00
|
|
|
|
|
|
|
diff = e1->exp - e2->exp;
|
|
|
|
|
|
|
|
if (!diff)
|
|
|
|
return; /* exponents are equal */
|
|
|
|
|
|
|
|
if (diff < 0) { /* e2 is larger */
|
|
|
|
/* shift e1 */
|
|
|
|
diff = -diff;
|
|
|
|
s = e1;
|
|
|
|
}
|
|
|
|
else /* e1 is larger */
|
|
|
|
/* shift e2 */
|
|
|
|
s = e2;
|
|
|
|
|
|
|
|
s->exp += diff;
|
1988-08-04 11:16:20 +00:00
|
|
|
b64_sft(&(s->m1), diff);
|
1988-04-07 10:57:49 +00:00
|
|
|
}
|