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 IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
00003  */
00004 
00005 /*
00006  * ====================================================
00007  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00008  *
00009  * Developed at SunPro, a Sun Microsystems, Inc. business.
00010  * Permission to use, copy, modify, and distribute this
00011  * software is freely granted, provided that this notice
00012  * is preserved.
00013  * ====================================================
00014  */
00015 
00016 #if defined(LIBM_SCCS) && !defined(lint)
00017 static char rcsid[] = "$NetBSD: $";
00018 #endif
00019 
00020 /*
00021  * finitel(x) returns 1 is x is finite, else 0;
00022  * no branching!
00023  */
00024 
00025 #include "math.h"
00026 #include "math_private.h"
00027 #include <math_ldbl_opt.h>
00028 
00029 int
00030 ___finitel (long double x)
00031 {
00032        int64_t hx;
00033        GET_LDOUBLE_MSW64(hx,x);
00034        return (int)((u_int64_t)((hx&0x7fffffffffffffffLL)
00035                              -0x7ff0000000000000LL)>>63);
00036 }
00037 hidden_ver (___finitel, __finitel)
00038 weak_alias (___finitel, ____finitel)
00039 #ifdef IS_IN_libm
00040 long_double_symbol (libm, ____finitel, finitel);
00041 long_double_symbol (libm, ___finitel, __finitel);
00042 #else
00043 long_double_symbol (libc, ____finitel, finitel);
00044 long_double_symbol (libc, ___finitel, __finitel);
00045 #endif