source: trunk/minix/lib/float/fif4.c@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 993 bytes
Line 
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/* $Header: /cvsup/minix/src/lib/float/fif4.c,v 1.1.1.1 2005/04/21 14:56:11 beng Exp $ */
7
8/*
9 MULTIPLY AND DISMEMBER PARTS (FIF 4)
10*/
11
12#include "FP_types.h"
13#include "FP_shift.h"
14
15void
16fif4(p,x,y)
17SINGLE x,y;
18struct fif4_returns *p;
19{
20
21 EXTEND e1,e2;
22
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;
33 }
34 if (e1.exp > 30 - SGL_M1LEFT) {
35 p->ipart = y;
36 p->fpart = 0;
37 return;
38 }
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));
46}
Note: See TracBrowser for help on using the repository browser.