Back to index

glibc  2.9
s_finitef.c
Go to the documentation of this file.
00001 /* s_finitef.c -- float version of s_finite.c.
00002  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
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: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $";
00018 #endif
00019 
00020 /*
00021  * finitef(x) returns 1 is x is finite, else 0;
00022  * no branching!
00023  */
00024 
00025 #include "math.h"
00026 #include "math_private.h"
00027 
00028 #ifdef __STDC__
00029        int __finitef(float x)
00030 #else
00031        int __finitef(x)
00032        float x;
00033 #endif
00034 {
00035        int32_t ix;
00036        GET_FLOAT_WORD(ix,x);
00037        return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31);
00038 }
00039 hidden_def (__finitef)
00040 weak_alias (__finitef, finitef)