xref: /original-bsd/lib/libc/sparc/gen/isnan.c (revision c3e32dec)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * %sccs.include.redist.c%
10  *
11  * from: $Header: isnan.c,v 1.1 91/07/08 19:03:34 torek Exp $
12  */
13 
14 #if defined(LIBC_SCCS) && !defined(lint)
15 static char sccsid[] = "@(#)isnan.c	8.1 (Berkeley) 06/04/93";
16 #endif /* LIBC_SCCS and not lint */
17 
18 #include <sys/types.h>
19 #include <machine/ieee.h>
20 
21 isnan(d)
22 	double d;
23 {
24 	register struct ieee_double *p = (struct ieee_double *)&d;
25 
26 	return (p->dbl_exp == DBL_EXP_INFNAN &&
27 	    (p->dbl_frach != 0 || p->dbl_fracl != 0));
28 }
29