fef4.c 608 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. (c) copyright 1988 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. /*
  7. SEPERATE INTO EXPONENT AND FRACTION (FEF 4)
  8. */
  9. #include "FP_types.h"
  10. void
  11. fef4(r,s1)
  12. SINGLE s1;
  13. struct fef4_returns *r;
  14. {
  15. EXTEND buf;
  16. register struct fef4_returns *p = r; /* make copy; r might refer
  17. to itself (see table)
  18. */
  19. extend(&s1,&buf,sizeof(SINGLE));
  20. if (buf.exp == 0 && buf.m1 == 0 && buf.m2 == 0) {
  21. p->e = 0;
  22. }
  23. else {
  24. p->e = buf.exp+1;
  25. buf.exp = -1;
  26. }
  27. compact(&buf,&p->f,sizeof(SINGLE));
  28. }