Uninitialized vector entry?
[minix3.git] / lib / float / fif4.c
blob059372469e65923cd06b19b647ec3ce779ca1702
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 */
6 /* $Header$ */
8 /*
9 MULTIPLY AND DISMEMBER PARTS (FIF 4)
12 #include "FP_types.h"
13 #include "FP_shift.h"
15 void
16 fif4(p,x,y)
17 SINGLE x,y;
18 struct fif4_returns *p;
21 EXTEND e1,e2;
23 extend(&y,&e1,sizeof(SINGLE));
24 extend(&x,&e2,sizeof(SINGLE));
25 /* do a multiply */
26 mul_ext(&e1,&e2);
27 e2 = e1;
28 compact(&e2,&y,sizeof(SINGLE));
29 if (e1.exp < 0) {
30 p->ipart = 0;
31 p->fpart = y;
32 return;
34 if (e1.exp > 30 - SGL_M1LEFT) {
35 p->ipart = y;
36 p->fpart = 0;
37 return;
39 b64_sft(&e1.mantissa, 63 - e1.exp);
40 b64_sft(&e1.mantissa, e1.exp - 63); /* "loose" low order bits */
41 compact(&e1,&(p->ipart),sizeof(SINGLE));
42 extend(&(p->ipart), &e2, sizeof(SINGLE));
43 extend(&y, &e1, sizeof(SINGLE));
44 sub_ext(&e1, &e2);
45 compact(&e1, &(p->fpart), sizeof(SINGLE));