home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / scheme / 2169 < prev    next >
Encoding:
Text File  |  1992-09-08  |  868 b   |  28 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!think.com!mintaka.lcs.mit.edu!zurich.ai.mit.edu!jaffer
  3. From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer)
  4. Subject: patch for scm4a11
  5. Message-ID: <JAFFER.92Sep8231217@camelot.ai.mit.edu>
  6. Sender: news@mintaka.lcs.mit.edu
  7. Organization: M.I.T. Artificial Intelligence Lab.
  8. Distribution: comp
  9. Date: Wed, 9 Sep 1992 04:12:17 GMT
  10. Lines: 16
  11.  
  12. From: robt@is.morgan.com (Rob Torop)
  13. (/ 1 1+i) gives a bus error on some systems.  Here is the patch:
  14. camelot>diff -c scl.c~ scl.c
  15. *** scl.c~    Wed Aug 26 21:35:35 1992
  16. --- scl.c    Tue Sep  8 23:04:31 1992
  17. ***************
  18. *** 809,816 ****
  19.       double r=REAL(y),i=IMAG(y);
  20.       long a=INUM(x);
  21.       double d=r*r+i*i;
  22. -     if CPLXP(x)
  23. -       return makdbl((a*r+IMAG(x)*i)/d,(IMAG(x)*r-a*i)/d);
  24.       return makdbl((a*r)/d,(-a*i)/d);
  25.         }
  26.         return makdbl(INUM(x)/REALPART(y) ,0.0);
  27. --- 809,814 ----
  28.