Pristine Ack-5.5
[Ack-5.5.git] / mach / proto / fp / sft_ext.c
1 /*
2   (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3   See the copyright notice in the ACK home directory, in the file "Copyright".
4 */
5
6 /* $Id: sft_ext.c,v 1.6 1994/06/24 13:32:45 ceriel Exp $ */
7
8 /*
9         SHIFT TWO EXTENDED NUMBERS INTO PROPER
10         ALIGNMENT FOR ADDITION (exponents are equal)
11         Numbers should not be zero on entry.
12 */
13
14 #include "FP_types.h"
15
16 void
17 sft_ext(e1,e2)
18 EXTEND  *e1,*e2;
19 {
20         register        EXTEND  *s;
21         register        int     diff;
22
23         diff = e1->exp - e2->exp;
24
25         if (!diff)
26                 return; /* exponents are equal  */
27
28         if (diff < 0)   { /* e2 is larger       */
29                         /* shift e1             */
30                 diff = -diff;
31                 s = e1;
32         }
33         else            /* e1 is larger         */
34                         /* shift e2             */
35                 s = e2;
36
37         s->exp += diff;
38         b64_sft(&(s->mantissa), diff);
39 }