Pristine Ack-5.5
[Ack-5.5.git] / mach / proto / fp / fef4.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: fef4.c,v 1.8 1994/06/24 13:32:01 ceriel Exp $ */
7
8 /*
9         SEPERATE INTO EXPONENT AND FRACTION (FEF 4)
10 */
11
12 #include        "FP_types.h"
13
14 void
15 fef4(r,s1)
16 SINGLE  s1;
17 struct fef4_returns     *r;
18 {
19         EXTEND  buf;
20         register struct fef4_returns    *p = r; /* make copy; r might refer
21                                                    to itself (see table)
22                                                 */
23
24         extend(&s1,&buf,sizeof(SINGLE));
25         if (buf.exp == 0 && buf.m1 == 0 && buf.m2 == 0) {
26                 p->e = 0;
27         }
28         else {
29                 p->e = buf.exp+1;
30                 buf.exp = -1;
31         }
32         compact(&buf,&p->f,sizeof(SINGLE));
33 }