Back to index

glibc  2.9
s_finitel.c
Go to the documentation of this file.
00001 /* s_finitel.c -- long double version of s_finite.c.
00002  * Conversion to long double by Ulrich Drepper,
00003  * Cygnus Support, drepper@cygnus.com.
00004  */
00005 
00006 /*
00007  * ====================================================
00008  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00009  *
00010  * Developed at SunPro, a Sun Microsystems, Inc. business.
00011  * Permission to use, copy, modify, and distribute this
00012  * software is freely granted, provided that this notice
00013  * is preserved.
00014  * ====================================================
00015  */
00016 
00017 #if defined(LIBM_SCCS) && !defined(lint)
00018 static char rcsid[] = "$NetBSD: $";
00019 #endif
00020 
00021 /*
00022  * finitel(x) returns 1 is x is finite, else 0;
00023  * no branching!
00024  */
00025 
00026 #include "math.h"
00027 #include "math_private.h"
00028 
00029 #ifdef __STDC__
00030        int __finitel(long double x)
00031 #else
00032        int __finitel(x)
00033        long double x;
00034 #endif
00035 {
00036        int32_t exp;
00037        GET_LDOUBLE_EXP(exp,x);
00038        return (int)((u_int32_t)((exp&0x7fff)-0x7fff)>>31);
00039 }
00040 hidden_def (__finitel)
00041 weak_alias (__finitel, finitel)