diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-04-27 17:46:48 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-04-27 17:46:48 +0000 |
commit | 4d4116761958b945bbc20fb5a5495c1cc7a897c0 (patch) | |
tree | 177e88316908c6c765dd3bde9ab4ac7cfb5a73b7 /lib/libc/quad/floatdidf.c | |
parent | 3fd98b3b1027bc45b04855550bc44e05c0a9e95d (diff) |
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@
Diffstat (limited to 'lib/libc/quad/floatdidf.c')
-rw-r--r-- | lib/libc/quad/floatdidf.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |