home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / ultrix / 6822 < prev    next >
Encoding:
Text File  |  1992-09-10  |  2.1 KB  |  84 lines

  1. Path: sparky!uunet!spool.mu.edu!agate!darkstar.UCSC.EDU!aztec!paul
  2. From: paul@aztec.ucsc.edu (Paul Tatarsky)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Software test of Floating Point Unit in 5000/240??
  5. Date: 10 Sep 1992 19:33:47 GMT
  6. Organization: UC Santa Cruz CIS/CE
  7. Lines: 71
  8. Distribution: world
  9. Message-ID: <18o7urINNppv@darkstar.UCSC.EDU>
  10. Reply-To: paul@terra.ucsc.edu
  11. NNTP-Posting-Host: aztec.ucsc.edu
  12.  
  13. A prof pointed out that the little code frag at the end of this 
  14. note was producing bad output on one of our 5000/240's and not on the
  15. other ones. I checked the kernel for anything odd, and then the manuals,
  16. and I have two questions:
  17.  
  18. 1. What is the story with the EMULFILT option? Older manuals say don't
  19. use it if you _have_ an fpu, newer ones say don't remove it from the
  20. config file. Well, it wasn't in my config file and when I added it
  21. and rebuilt/rebooted, I got the same results. 
  22.  
  23. 2. Anyone have a sure fire software test of the FPU unit? 
  24.  
  25. Now on to the test:
  26.  
  27. The environment: Ultrix 4.2A, DECstations 5000/240
  28. Both have FPU units: fpu0 ( version 4.0, implementation 3 ) 
  29.  
  30. The code frag float.c:
  31.  
  32. #include <stdio.h>
  33.  
  34. main()
  35. {
  36.     float x,y;
  37.     int i;
  38.  
  39.     y = .998;
  40.     for(i = 0; i < 10; i++){
  41.         x = (1.0/(1.0+y));
  42.         /*    z = 1.0/1.998;*/
  43.         printf("%e %e\n",x,y);
  44.         y = y-.001;
  45.     }
  46. }
  47.  
  48. On 5000/240 A:
  49. > cc -o float float.c
  50. > float
  51. 5.005005e-01 9.980000e-01
  52. 5.007511e-01 9.970000e-01
  53. 5.010020e-01 9.960001e-01
  54. 5.012531e-01 9.950001e-01
  55. 5.015045e-01 9.940001e-01
  56. 5.017561e-01 9.930001e-01
  57. 5.020080e-01 9.920001e-01
  58. 5.022601e-01 9.910001e-01
  59. 5.025125e-01 9.900001e-01
  60. 5.027652e-01 9.890001e-01
  61.  
  62. On 5000/240 B:
  63. > float
  64. 5.000000e-01 9.980000e-01
  65. 5.000000e-01 9.970000e-01
  66. 5.000000e-01 9.960001e-01
  67. 5.000000e-01 9.950001e-01
  68. 5.000000e-01 9.940001e-01
  69. 5.000000e-01 9.930001e-01
  70. 5.000000e-01 9.920001e-01
  71. 5.000000e-01 9.910001e-01
  72. 5.000000e-01 9.900001e-01
  73. 5.000000e-01 9.890001e-01
  74.  
  75. What is going on here? Further configuration info available on request.
  76. Eternal thanks to anyone with a solution.
  77.  
  78. -- 
  79.  
  80.  Paul Tatarsky         email: paul@cse.ucsc.edu
  81.  UC Santa Cruz
  82.  CIS/CE Board          
  83.  Technical Staff
  84.