summaryrefslogtreecommitdiff
path: root/lib/libc/arch/arm32/gen/isinf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/arm32/gen/isinf.c')
-rw-r--r--lib/libc/arch/arm32/gen/isinf.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/libc/arch/arm32/gen/isinf.c b/lib/libc/arch/arm32/gen/isinf.c
index e55495f670c..79a6136194a 100644
--- a/lib/libc/arch/arm32/gen/isinf.c
+++ b/lib/libc/arch/arm32/gen/isinf.c
@@ -1,8 +1,8 @@
-/* $NetBSD: isinf.c,v 1.1 1996/02/16 20:48:20 mark Exp $ */
+/* $OpenBSD: isinf.c,v 1.2 1996/05/22 11:39:15 deraadt Exp $ */
+/* $NetBSD: isinf.c,v 1.2 1996/05/12 20:50:54 mark Exp $ */
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+/*
+ * Copyright (c) 1996 Mark Brinicombe
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -14,16 +14,16 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
+ * This product includes software developed by Mark Brinicombe
+ * for the NetBSD project.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -31,34 +31,26 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: isinf.c,v 1.1 1996/05/01 12:51:19 deraadt Exp $
*/
#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+int
isnan(d)
double d;
{
- register struct IEEEdp {
- u_int manh : 20;
- u_int exp : 11;
- u_int sign : 1;
- u_int manl;
- } *p = (struct IEEEdp *)&d;
+ register 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 || p->dbl_fracl));
}
+int
isinf(d)
double d;
{
- register struct IEEEdp {
- u_int manh : 20;
- u_int exp : 11;
- u_int sign : 1;
- u_int manl;
- } *p = (struct IEEEdp *)&d;
+ register 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 && !p->dbl_fracl);
}