diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-05-11 21:40:01 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-05-11 21:40:01 +0000 |
commit | 21d006be94ca13a37e7a1d4bd7dcdaa87878c6b2 (patch) | |
tree | a112057d7f1b4d65398b92c594bee67bf7adc21d /lib | |
parent | 0fb4d3baa7c529cc99fde789d5100bacd3cf535d (diff) |
PowerPC is big endian, not little endian. This fixes isinf() and isnan()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/arch/powerpc/gen/isinf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/libc/arch/powerpc/gen/isinf.c b/lib/libc/arch/powerpc/gen/isinf.c index abe138c83cd..6667cb90a28 100644 --- a/lib/libc/arch/powerpc/gen/isinf.c +++ b/lib/libc/arch/powerpc/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.2 2000/03/01 17:31:22 todd Exp $ */ +/* $OpenBSD: isinf.c,v 1.3 2001/05/11 21:40:00 drahn Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -34,33 +34,34 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -/*static char sccsid[] = "from: @(#)isinf.c 5.1 (Berkeley) 3/18/91";*/ -static char rcsid[] = "$OpenBSD: isinf.c,v 1.2 2000/03/01 17:31:22 todd Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 2001/05/11 21:40:00 drahn Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> +int isnan(d) double d; { register struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; u_int sign : 1; + u_int exp : 11; + u_int manh : 20; + u_int manl : 32; } *p = (struct IEEEdp *)&d; return(p->exp == 2047 && (p->manh || p->manl)); } +int isinf(d) double d; { register struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; u_int sign : 1; + u_int exp : 11; + u_int manh : 20; + u_int manl : 32; } *p = (struct IEEEdp *)&d; return(p->exp == 2047 && !p->manh && !p->manl); |