diff options
author | 2004-04-27 17:46:46 +0000 | |
---|---|---|
committer | 2004-04-27 17:46:46 +0000 | |
commit | 99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f (patch) | |
tree | 1e8c75d2d5dda9d3c6463cc88fa8f87f423635fc /lib/libc/quad/floatdisf.c | |
parent | unbreak^2 (diff) | |
download | wireguard-openbsd-99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f.tar.xz wireguard-openbsd-99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f.zip |
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/floatdisf.c')
-rw-r--r-- | lib/libc/quad/floatdisf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/quad/floatdisf.c b/lib/libc/quad/floatdisf.c index 424e752d2cd..441d72a90c1 100644 --- a/lib/libc/quad/floatdisf.c +++ b/lib/libc/quad/floatdisf.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: floatdisf.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: floatdisf.c,v 1.4 2004/04/27 17:46:46 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include "quad.h" @@ -58,14 +58,14 @@ __floatdisf(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 f, add LONG_BITS to + * has the units. Ideally we could just set f, 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. * * Using double here may be excessive paranoia. */ - f = (double)u.ul[H] * (((long)1 << (LONG_BITS - 2)) * 4.0); + f = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0); f += u.ul[L]; return (neg ? -f : f); |