]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/ieee754/dbl-64/s_finite.c
Optimize use of isnan, isinf, finite
[thirdparty/glibc.git] / sysdeps / ieee754 / dbl-64 / s_finite.c
CommitLineData
f7eac6eb
RM
1/* @(#)s_finite.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
cccda09f 8 * software is freely granted, provided that this notice
f7eac6eb
RM
9 * is preserved.
10 * ====================================================
11 */
12
13#if defined(LIBM_SCCS) && !defined(lint)
14static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
15#endif
16
17/*
18 * finite(x) returns 1 is x is finite, else 0;
19 * no branching!
20 */
21
22#include "math.h"
23#include "math_private.h"
24
7edb55ce 25#undef __finite
f7eac6eb
RM
26#ifdef __STDC__
27 int __finite(double x)
28#else
29 int __finite(x)
30 double x;
31#endif
32{
33 int32_t hx;
34 GET_HIGH_WORD(hx,x);
35 return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
36}
76f2646f 37hidden_def (__finite)
f7eac6eb 38weak_alias (__finite, finite)
cccda09f
UD
39#ifdef NO_LONG_DOUBLE
40strong_alias (__finite, __finitel)
41weak_alias (__finite, finitel)
42#endif