. service tells you which device it couldn't stat
[minix3.git] / lib / float / fif8.c
blob9f1b9b15e024c2d3d4e3d17229a916589aada6a6
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 8)
12 #include "FP_types.h"
13 #include "FP_shift.h"
15 void
16 fif8(p,x,y)
17 DOUBLE x,y;
18 struct fif8_returns *p;
21 EXTEND e1,e2;
23 extend(&y.d[0],&e1,sizeof(DOUBLE));
24 extend(&x.d[0],&e2,sizeof(DOUBLE));
25 /* do a multiply */
26 mul_ext(&e1,&e2);
27 e2 = e1;
28 compact(&e2, &y.d[0], sizeof(DOUBLE));
29 if (e1.exp < 0) {
30 p->ipart.d[0] = 0;
31 p->ipart.d[1] = 0;
32 p->fpart = y;
33 return;
35 if (e1.exp > 62 - DBL_M1LEFT) {
36 p->ipart = y;
37 p->fpart.d[0] = 0;
38 p->fpart.d[1] = 0;
39 return;
41 b64_sft(&e1.mantissa, 63 - e1.exp);
42 b64_sft(&e1.mantissa, e1.exp - 63); /* "loose" low order bits */
43 compact(&e1, &(p->ipart.d[0]), sizeof(DOUBLE));
44 extend(&(p->ipart.d[0]), &e2, sizeof(DOUBLE));
45 extend(&y.d[0], &e1, sizeof(DOUBLE));
46 sub_ext(&e1, &e2);
47 compact(&e1, &(p->fpart.d[0]), sizeof(DOUBLE));