1989-07-10 11:17:19 +00:00
|
|
|
/*
|
|
|
|
(c) copyright 1989 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Header$ */
|
|
|
|
|
1991-02-19 13:53:04 +00:00
|
|
|
#include "flt_misc.h"
|
1993-10-21 12:50:58 +00:00
|
|
|
#if __STDC__ > 0
|
|
|
|
void
|
|
|
|
#endif
|
1989-07-10 11:17:19 +00:00
|
|
|
flt_nrm(e)
|
|
|
|
register flt_arith *e;
|
|
|
|
{
|
1989-08-01 16:34:01 +00:00
|
|
|
if ((e->m1 | e->m2) == 0L) {
|
|
|
|
e->flt_exp = 0;
|
|
|
|
e->flt_sign = 0;
|
1989-07-10 11:17:19 +00:00
|
|
|
return;
|
1989-08-01 16:34:01 +00:00
|
|
|
}
|
1989-07-10 11:17:19 +00:00
|
|
|
|
|
|
|
/* if top word is zero mov low word */
|
|
|
|
/* to top word, adjust exponent value */
|
|
|
|
if (e->m1 == 0L) {
|
|
|
|
e->m1 = e->m2;
|
|
|
|
e->m2 = 0L;
|
|
|
|
e->flt_exp -= 32;
|
|
|
|
}
|
|
|
|
if ((e->m1 & 0x80000000) == 0) {
|
|
|
|
long l = 0x40000000;
|
|
|
|
int cnt = -1;
|
|
|
|
|
|
|
|
while (! (l & e->m1)) {
|
|
|
|
l >>= 1;
|
|
|
|
cnt--;
|
|
|
|
}
|
|
|
|
e->flt_exp += cnt;
|
1989-07-11 09:15:17 +00:00
|
|
|
flt_b64_sft(&(e->flt_mantissa), cnt);
|
1989-07-10 11:17:19 +00:00
|
|
|
}
|
|
|
|
}
|