summaryrefslogtreecommitdiff
path: root/lib/libc/arch/m88k/gen/isinf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/m88k/gen/isinf.c')
-rw-r--r--lib/libc/arch/m88k/gen/isinf.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/lib/libc/arch/m88k/gen/isinf.c b/lib/libc/arch/m88k/gen/isinf.c
index d935c1f4c68..9cd731ae0d8 100644
--- a/lib/libc/arch/m88k/gen/isinf.c
+++ b/lib/libc/arch/m88k/gen/isinf.c
@@ -1,8 +1,12 @@
-/* $OpenBSD: isinf.c,v 1.2 2000/03/01 17:31:20 todd Exp $ */
+/* $OpenBSD: isinf.c,v 1.3 2001/09/10 22:38:11 millert Exp $ */
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,34 +38,18 @@
*/
#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:20 todd Exp $";
+static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 2001/09/10 22:38:11 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
+#include <machine/ieee.h>
-isnan(d)
- double d;
-{
- register struct IEEEdp {
- 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 sign : 1;
- u_int exp : 11;
- u_int manh : 20;
- u_int manl : 32;
- } *p = (struct IEEEdp *)&d;
+ struct ieee_double *p = (struct ieee_double *)&d;
- return(p->exp == 2047 && !p->manh && !p->manl);
+ return (p->dbl_exp == DBL_EXP_INFNAN &&
+ p->dbl_frach == 0 && p->dbl_fracl == 0);
}