flt_chk.c 500 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. (c) copyright 1989 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #include "flt_misc.h"
  7. int flt_status = 0;
  8. void
  9. flt_chk(e)
  10. register flt_arith *e;
  11. {
  12. if (e->flt_exp >= EXT_MAX) {
  13. flt_status = FLT_OVFL;
  14. e->flt_exp = EXT_MAX;
  15. e->m1 = 0x80000000;
  16. e->m2 = 0;
  17. }
  18. if (e->flt_exp <= EXT_MIN) {
  19. flt_status = FLT_UNFL;
  20. e->flt_exp = 0;
  21. e->m1 = 0;
  22. e->flt_sign = 0;
  23. e->m2 = 0;
  24. }
  25. }