xref: /csrg-svn/lib/libc/hp300/gen/isinf.c (revision 61117)
147559Sbostic /*-
2*61117Sbostic  * Copyright (c) 1991, 1993
3*61117Sbostic  *	The Regents of the University of California.  All rights reserved.
447559Sbostic  *
547559Sbostic  * %sccs.include.redist.c%
647559Sbostic  */
747559Sbostic 
847559Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*61117Sbostic static char sccsid[] = "@(#)isinf.c	8.1 (Berkeley) 06/04/93";
1047559Sbostic #endif /* LIBC_SCCS and not lint */
1147559Sbostic 
1247559Sbostic #include <sys/types.h>
1347559Sbostic 
isnan(d)1447559Sbostic isnan(d)
1547559Sbostic 	double d;
1647559Sbostic {
1747559Sbostic 	register struct IEEEdp {
1847559Sbostic 		u_int sign :  1;
1947559Sbostic 		u_int  exp : 11;
2047559Sbostic 		u_int manh : 20;
2147559Sbostic 		u_int manl : 32;
2247559Sbostic 	} *p = (struct IEEEdp *)&d;
2347559Sbostic 
2447559Sbostic 	return(p->exp == 2047 && (p->manh || p->manl));
2547559Sbostic }
2647559Sbostic 
isinf(d)2747559Sbostic isinf(d)
2847559Sbostic 	double d;
2947559Sbostic {
3047559Sbostic 	register struct IEEEdp {
3147559Sbostic 		u_int sign :  1;
3247559Sbostic 		u_int  exp : 11;
3347559Sbostic 		u_int manh : 20;
3447559Sbostic 		u_int manl : 32;
3547559Sbostic 	} *p = (struct IEEEdp *)&d;
3647559Sbostic 
3747559Sbostic 	return(p->exp == 2047 && !p->manh && !p->manl);
3847559Sbostic }
39