home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17599 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.4 KB  |  54 lines

  1. Path: sparky!uunet!rayssd!galaxia!animato!rlcarr
  2. From: rlcarr@animato.network23.com (Rich Carreiro)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: SAS/C 6.1 math=68881 BUG
  5. Distribution: world
  6. Message-ID: <rlcarr.0969@animato.network23.com>
  7. X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
  8. Date: 19 Dec 92 00:52:35 EDT
  9. Organization: The Other Side of Life
  10. Lines: 42
  11.  
  12.  
  13. Has anyone else been bitten by this weird one?  I have reported it via
  14. EMITS.  Haven't heard anything yet.
  15.  
  16. /***
  17. * Problems with using the math=68881 option.
  18. * Copyright 1992 by Richard L. Carreiro
  19. *
  20. * Command line: sc math=68881 verbose link test.c
  21. * Release: SAS/C 6.1
  22. * Configuration: A2000, A2630 (4 meg RAM onboard), SupraRAM (4 meg onboard),
  23. *                AmigaDOS 2.04, A2091 SCSI controller
  24. *
  25. * Note that this program works fine with "math=ieee", "math=standard", and
  26. * "math=ffp".
  27. *
  28. ***/
  29.  
  30. #include <stdlib.h>
  31. #include <stdio.h>
  32. #include <math.h>
  33. #include <m68881.h>
  34.  
  35. main()
  36. {
  37.   double y;
  38.   double x;
  39.   
  40.   x = 1.0;
  41.  
  42.   y = sin(x *   (3.14159265/100000.0)  ); 
  43.   printf("y=%f\n", y);               /* this will print NaN0.000000 */
  44.  
  45.   y = sin(x * 3.14159265/100000.0);  /* this will crash the program, getting */
  46.                                      /* error 8000 0004 or 8000 0008         */
  47.   printf("y=%f\n", y);
  48. }
  49.  
  50. -- 
  51. Rich Carreiro                                  Home: (401)841-8514
  52. rlcarr@animato.network23.com
  53. uunet.uu.net!animato!rlcarr
  54.