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".
9 CONVERT FLOAT TO UNSIGNED (CFU m n)
11 N.B. The caller must know what it is getting.
12 A LONG is always returned. If it is an
13 integer the high byte is cleared first.
21 int ds; /* destination size (2 or 4) */
22 int ss; /* source size (4 or 8) */
23 DOUBLE src; /* assume worst case */
27 short newint, max_exp;
29 extend(&src.d[0],&buf,ss); /* get extended format */
30 if (buf.exp < 0) { /* no conversion needed */
34 max_exp = (ds << 3) - 1;
35 if (buf.exp > max_exp) {
36 trap(EIOVFL); /* integer overflow */
39 new = buf.m1 >> (31-buf.exp);