source: trunk/minix/lib/ack/float/sft_ext.fc@ 22

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

Minix 3.1.2a

File size: 760 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/ack/float/sft_ext.fc,v 1.1 2005/10/10 15:27:43 beng 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
16void
17sft_ext(e1,e2)
18EXTEND *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}
Note: See TracBrowser for help on using the repository browser.