diff options
Diffstat (limited to 'lib/libc/arch/i386/gen/isinf.c')
-rw-r--r-- | lib/libc/arch/i386/gen/isinf.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/lib/libc/arch/i386/gen/isinf.c b/lib/libc/arch/i386/gen/isinf.c index 02128987bce..35898dc011f 100644 --- a/lib/libc/arch/i386/gen/isinf.c +++ b/lib/libc/arch/i386/gen/isinf.c @@ -1,6 +1,12 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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 @@ -32,35 +38,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 1996/08/19 08:12:31 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert 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; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && (p->manh || p->manl)); -} +#include <machine/ieee.h> int isinf(d) double d; { - register struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; - u_int sign : 1; - } *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); } |