147560Sbostic /*- 2*61221Sbostic * Copyright (c) 1991, 1993 3*61221Sbostic * The Regents of the University of California. All rights reserved. 447560Sbostic * 547560Sbostic * %sccs.include.redist.c% 647560Sbostic */ 747560Sbostic 847560Sbostic #if defined(LIBC_SCCS) && !defined(lint) 9*61221Sbostic static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 06/04/93"; 1047560Sbostic #endif /* LIBC_SCCS and not lint */ 1147560Sbostic 1247560Sbostic #include <sys/types.h> 1347560Sbostic isnan(d)1447560Sbosticisnan(d) 1547560Sbostic double d; 1647560Sbostic { 1747560Sbostic register struct IEEEdp { 1847560Sbostic u_int manl : 32; 1947560Sbostic u_int manh : 20; 2047560Sbostic u_int exp : 11; 2147560Sbostic u_int sign : 1; 2247560Sbostic } *p = (struct IEEEdp *)&d; 2347560Sbostic 2447560Sbostic return(p->exp == 2047 && (p->manh || p->manl)); 2547560Sbostic } 2647560Sbostic isinf(d)2747560Sbosticisinf(d) 2847560Sbostic double d; 2947560Sbostic { 3047560Sbostic register struct IEEEdp { 3147560Sbostic u_int manl : 32; 3247560Sbostic u_int manh : 20; 3347560Sbostic u_int exp : 11; 3447560Sbostic u_int sign : 1; 3547560Sbostic } *p = (struct IEEEdp *)&d; 3647560Sbostic 3747560Sbostic return(p->exp == 2047 && !p->manh && !p->manl); 3847560Sbostic } 39