signbit.c 330 B

123456789101112131415161718192021222324
  1. #include "arith.h"
  2. #ifndef Long
  3. #define Long long
  4. #endif
  5. int
  6. #ifdef KR_headers
  7. signbit_f2c(x) double *x;
  8. #else
  9. signbit_f2c(double *x)
  10. #endif
  11. {
  12. #ifdef IEEE_MC68k
  13. if (*(Long*)x & 0x80000000)
  14. return 1;
  15. #else
  16. #ifdef IEEE_8087
  17. if (((Long*)x)[1] & 0x80000000)
  18. return 1;
  19. #endif /*IEEE_8087*/
  20. #endif /*IEEE_MC68k*/
  21. return 0;
  22. }