xref: /csrg-svn/lib/libc/hp300/gen/isinf.c (revision 47559)
1*47559Sbostic /*-
2*47559Sbostic  * Copyright (c) 1991 The Regents of the University of California.
3*47559Sbostic  * All rights reserved.
4*47559Sbostic  *
5*47559Sbostic  * %sccs.include.redist.c%
6*47559Sbostic  */
7*47559Sbostic 
8*47559Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*47559Sbostic static char sccsid[] = "@(#)isinf.c	5.1 (Berkeley) 03/18/91";
10*47559Sbostic #endif /* LIBC_SCCS and not lint */
11*47559Sbostic 
12*47559Sbostic #include <sys/types.h>
13*47559Sbostic 
14*47559Sbostic isnan(d)
15*47559Sbostic 	double d;
16*47559Sbostic {
17*47559Sbostic 	register struct IEEEdp {
18*47559Sbostic 		u_int sign :  1;
19*47559Sbostic 		u_int  exp : 11;
20*47559Sbostic 		u_int manh : 20;
21*47559Sbostic 		u_int manl : 32;
22*47559Sbostic 	} *p = (struct IEEEdp *)&d;
23*47559Sbostic 
24*47559Sbostic 	return(p->exp == 2047 && (p->manh || p->manl));
25*47559Sbostic }
26*47559Sbostic 
27*47559Sbostic isinf(d)
28*47559Sbostic 	double d;
29*47559Sbostic {
30*47559Sbostic 	register struct IEEEdp {
31*47559Sbostic 		u_int sign :  1;
32*47559Sbostic 		u_int  exp : 11;
33*47559Sbostic 		u_int manh : 20;
34*47559Sbostic 		u_int manl : 32;
35*47559Sbostic 	} *p = (struct IEEEdp *)&d;
36*47559Sbostic 
37*47559Sbostic 	return(p->exp == 2047 && !p->manh && !p->manl);
38*47559Sbostic }
39