s_isinff.c 436 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Written by J.T. Conklin <jtc@netbsd.org>.
  3. * Public domain.
  4. */
  5. /*
  6. * isinff(x) returns 1 if x is inf, -1 if x is -inf, else 0;
  7. * no branching!
  8. */
  9. #include "math.h"
  10. #include "math_private.h"
  11. libm_hidden_proto(__isinff)
  12. int
  13. __isinff (float x)
  14. {
  15. int32_t ix,t;
  16. GET_FLOAT_WORD(ix,x);
  17. t = ix & 0x7fffffff;
  18. t ^= 0x7f800000;
  19. t |= -t;
  20. return ~(t >> 31) & (ix >> 30);
  21. }
  22. libm_hidden_def(__isinff)
  23. strong_alias (__isinff, isinff)