floatdisf.c (c6879c6c14eedbd060ba588a3129a6c60ebbe783) | floatdisf.c (feb1d5507e4730fe401e6ae28a56579b814519ef) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1992, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 54 unchanged lines hidden (view full) --- 63 * Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L] 64 * has the units. Ideally we could just set f, add LONG_BITS to 65 * its exponent, and then add the units, but this is portable 66 * code and does not know how to get at an exponent. Machine- 67 * specific code may be able to do this more efficiently. 68 * 69 * Using double here may be excessive paranoia. 70 */ | 1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1992, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 54 unchanged lines hidden (view full) --- 63 * Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L] 64 * has the units. Ideally we could just set f, add LONG_BITS to 65 * its exponent, and then add the units, but this is portable 66 * code and does not know how to get at an exponent. Machine- 67 * specific code may be able to do this more efficiently. 68 * 69 * Using double here may be excessive paranoia. 70 */ |
71 f = (double)u.ul[H] * ((1 << (LONG_BITS - 2)) * 4.0); | 71 f = (double)u.ul[H] * ((1L << (LONG_BITS - 2)) * 4.0); |
72 f += u.ul[L]; 73 74 return (neg ? -f : f); 75} | 72 f += u.ul[L]; 73 74 return (neg ? -f : f); 75} |