From 4d4116761958b945bbc20fb5a5495c1cc7a897c0 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 27 Apr 2004 17:46:48 +0000 Subject: A quad is two ints, not two longs. Also fix some problems with conversions from floating point to quad. Problem reported by Marcus Holland-Moritz. From NetBSD. ok millert@ --- lib/libc/quad/floatdidf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libc/quad/floatdidf.c') diff --git a/lib/libc/quad/floatdidf.c b/lib/libc/quad/floatdidf.c index 1b6a28fae9b..391de2b42ef 100644 --- a/lib/libc/quad/floatdidf.c +++ b/lib/libc/quad/floatdidf.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: floatdidf.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: floatdidf.c,v 1.4 2004/04/27 17:46:46 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include "quad.h" @@ -58,12 +58,12 @@ __floatdidf(x) /* * Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L] - * has the units. Ideally we could just set d, add LONG_BITS to + * has the units. Ideally we could just set d, add INT_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. */ - d = (double)u.ul[H] * (((long)1 << (LONG_BITS - 2)) * 4.0); + d = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0); d += u.ul[L]; return (neg ? -d : d); -- cgit v1.2.3