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 INTEGER TO FLOAT (CIF n 8)
11 THIS ROUTINE WORKS BY FILLING AN EXTENDED
12 WITH THE INTEGER VALUE IN EXTENDED FORMAT
13 AND USES COMPACT() TO PUT IT INTO THE PROPER
14 FLOATING POINT PRECISION.
21 int ss
; /* source size */
22 long src
; /* largest possible integer to convert */
25 DOUBLE
*result
; /* for return value */
29 result
= (DOUBLE
*) ((void *) &ss
); /* always */
31 if (ss
== sizeof(long)) {
44 /* ESTABLISHED THAT src != 0 */
45 /* adjust exponent field */
46 buf
.sign
= (i_src
< 0) ? 0x8000 : 0;
47 /* clear sign bit of integer */
48 /* move to mantissa field */
49 buf
.m1
= (i_src
< 0) ? -i_src
: i_src
;
50 /* adjust mantissa field */
51 if (ss
!= sizeof(long))
54 compact(&buf
,&result
->d
[0],8);