s_isinff.c 402 B

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