date and time created 91/03/18 16:52:38 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 19 Mar 1991 08:52:38 +0000 (00:52 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 19 Mar 1991 08:52:38 +0000 (00:52 -0800)
SCCS-vsn: lib/libc/hp300/gen/isinf.c 5.1

usr/src/lib/libc/hp300/gen/isinf.c [new file with mode: 0644]

diff --git a/usr/src/lib/libc/hp300/gen/isinf.c b/usr/src/lib/libc/hp300/gen/isinf.c
new file mode 100644 (file)
index 0000000..1cf11ec
--- /dev/null
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)isinf.c    5.1 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.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));
+}
+
+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;
+
+       return(p->exp == 2047 && !p->manh && !p->manl);
+}