Rev | Line | |
---|
[9] | 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/sft_ext.c,v 1.1.1.1 2005/04/21 14:56:11 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 |
|
---|
| 16 | void
|
---|
| 17 | sft_ext(e1,e2)
|
---|
| 18 | EXTEND *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.