* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)floatdisf.c 8.1 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
* Convert (signed) quad to float.
* Get an unsigned number first, by negating if necessary.
* Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L]
* has the units. Ideally we could just set f, add LONG_BITS to
* its exponent, and then add the units, but this is portable
* code and does not know how to get at an exponent. Machine-
* specific code may be able to do this more efficiently.
* Using double here may be excessive paranoia.
f
= (double)u
.ul
[H
] * ((1 << (LONG_BITS
- 2)) * 4.0);