s_finitef.c 778 B

1234567891011121314151617181920212223242526272829303132
  1. /* s_finitef.c -- float version of s_finite.c.
  2. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  3. */
  4. /*
  5. * ====================================================
  6. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  7. *
  8. * Developed at SunPro, a Sun Microsystems, Inc. business.
  9. * Permission to use, copy, modify, and distribute this
  10. * software is freely granted, provided that this notice
  11. * is preserved.
  12. * ====================================================
  13. */
  14. #include <sys/cdefs.h>
  15. /*
  16. * finitef(x) returns 1 is x is finite, else 0;
  17. * no branching!
  18. */
  19. #include "openlibm.h"
  20. #include "math_private.h"
  21. int finitef(float x)
  22. {
  23. int32_t ix;
  24. GET_FLOAT_WORD(ix,x);
  25. return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31);
  26. }