diff options
Diffstat (limited to 'lib/libc/arch/m88k')
-rw-r--r-- | lib/libc/arch/m88k/gen/isinf.c | 40 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/isnan.c | 10 |
2 files changed, 19 insertions, 31 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); } diff --git a/lib/libc/arch/m88k/gen/isnan.c b/lib/libc/arch/m88k/gen/isnan.c index 5360c779456..a84ace4511c 100644 --- a/lib/libc/arch/m88k/gen/isnan.c +++ b/lib/libc/arch/m88k/gen/isnan.c @@ -1,4 +1,5 @@ -/* $OpenBSD: isnan.c,v 1.2 2000/03/01 17:31:20 todd Exp $ */ +/* $OpenBSD: isnan.c,v 1.3 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,21 +35,20 @@ * 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. - * - * from: Header: isnan.c,v 1.1 91/07/08 19:03:34 torek Exp */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isnan.c 8.1 (Berkeley) 6/4/93"; +static char rcsid[] = "$OpenBSD: isnan.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> +int isnan(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && (p->dbl_frach != 0 || p->dbl_fracl != 0)); |