s_finitef.c revision 2116
1186690Sobrien/* s_finitef.c -- float version of s_finite.c. 2186690Sobrien * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3186690Sobrien */ 4186690Sobrien 5186690Sobrien/* 6186690Sobrien * ==================================================== 7186690Sobrien * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8186690Sobrien * 9186690Sobrien * Developed at SunPro, a Sun Microsystems, Inc. business. 10186690Sobrien * Permission to use, copy, modify, and distribute this 11186690Sobrien * software is freely granted, provided that this notice 12186690Sobrien * is preserved. 13186690Sobrien * ==================================================== 14186690Sobrien */ 15186690Sobrien 16186690Sobrien#ifndef lint 17186690Sobrienstatic char rcsid[] = "$Id: s_finitef.c,v 1.2 1994/08/18 23:06:45 jtc Exp $"; 18186690Sobrien#endif 19186690Sobrien 20186690Sobrien/* 21186690Sobrien * finitef(x) returns 1 is x is finite, else 0; 22186690Sobrien * no branching! 23186690Sobrien */ 24186690Sobrien 25186690Sobrien#include "math.h" 26186690Sobrien#include "math_private.h" 27186690Sobrien 28186690Sobrien#ifdef __STDC__ 29186690Sobrien int finitef(float x) 30186690Sobrien#else 31186690Sobrien int finitef(x) 32186690Sobrien float x; 33186690Sobrien#endif 34186690Sobrien{ 35186690Sobrien int32_t ix; 36186690Sobrien GET_FLOAT_WORD(ix,x); 37186690Sobrien return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31); 38186690Sobrien} 39186690Sobrien