Remove register keyword usage.
[games.git] / lib / libcr / alpha / gen / isinf.c
1 /*      $NetBSD: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp $    */
2 /* $FreeBSD: src/lib/libc/alpha/gen/isinf.c,v 1.1.1.1.6.1 2000/08/21 21:09:29 jhb Exp $ */
3 /* $DragonFly: src/lib/libcr/alpha/gen/Attic/isinf.c,v 1.3 2004/10/25 19:38:02 drhodus Exp $ */
4
5 /*
6  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
7  * All rights reserved.
8  *
9  * Author: Chris G. Demetriou
10  * 
11  * Permission to use, copy, modify and distribute this software and
12  * its documentation is hereby granted, provided that both the copyright
13  * notice and this permission notice appear in all copies of the
14  * software, derivative works or modified versions, and any portions
15  * thereof, and that both notices appear in supporting documentation.
16  * 
17  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
18  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
19  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
20  * 
21  * Carnegie Mellon requests users of this software to return to
22  *
23  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
24  *  School of Computer Science
25  *  Carnegie Mellon University
26  *  Pittsburgh PA 15213-3890
27  *
28  * any improvements or extensions that they make and grant Carnegie the
29  * rights to redistribute these changes.
30  */
31
32 #include <sys/types.h>
33 #include <machine/ieee.h>
34 #include <math.h>
35
36 int
37 isnan(d)
38         double d;
39 {
40         struct ieee_double *p = (struct ieee_double *)&d;
41
42         return (p->dbl_exp == DBL_EXP_INFNAN &&
43             (p->dbl_frach || p->dbl_fracl));
44 }
45
46 int
47 isinf(d)
48         double d;
49 {
50         struct ieee_double *p = (struct ieee_double *)&d;
51
52         return (p->dbl_exp == DBL_EXP_INFNAN &&
53             !p->dbl_frach && !p->dbl_fracl);
54 }