home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / sgi / 13371 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  8.0 KB

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!ringer!lonestar.utsa.edu!nashpl
  2. From: nashpl@lonestar.utsa.edu (Patrick L. Nash)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Machine Constants for indigo/mips
  5. Message-ID: <1992Sep8.115050.29330@ringer.cs.utsa.edu>
  6. Date: 8 Sep 92 11:50:50 GMT
  7. Sender: news@ringer.cs.utsa.edu
  8. Distribution: na
  9. Organization: University of Texas at San Antonio
  10. Lines: 265
  11. Nntp-Posting-Host: lonestar.utsa.edu
  12.  
  13.  
  14. MACHINE CONSTANTS FOR THE indigo/MIPS are needed before one can use the slatec
  15. libraries (which can be obtained via anon ftp from ncar.ucar.edu). If anyone 
  16. knows the values needed to fill in the two 'tables' marked below,
  17. could you email them to me?
  18.  
  19. Your help is greatly appreciated.
  20.  
  21.  
  22.  
  23.  
  24.       INTEGER FUNCTION I1MACH(I)
  25. C***BEGIN PROLOGUE  I1MACH
  26. C***DATE WRITTEN   750101   (YYMMDD)
  27. C***REVISION DATE  870618   (YYMMDD)
  28. C***CATEGORY NO.  R1
  29. C***KEYWORDS  LIBRARY=SLATEC,TYPE=INTEGER(I1MACH-I),MACHINE CONSTANTS
  30. C***AUTHOR  FOX, P. A., (BELL LABS)
  31. C           HALL, A. D., (BELL LABS)
  32. C           SCHRYER, N. L., (BELL LABS)
  33. C***PURPOSE  Returns integer machine dependent constants
  34. C***DESCRIPTION
  35. C
  36. C     I1MACH can be used to obtain machine-dependent parameters
  37. C     for the local machine environment.  It is a function
  38. C     subroutine with one (input) argument, and can be called
  39. C     as follows, for example
  40. C
  41. C          K = I1MACH(I)
  42. C
  43. C     where I=1,...,16.  The (output) value of K above is
  44. C     determined by the (input) value of I.  The results for
  45. C     various values of I are discussed below.
  46. C
  47. C  I/O unit numbers.
  48. C    I1MACH( 1) = the standard input unit.
  49. C    I1MACH( 2) = the standard output unit.
  50. C    I1MACH( 3) = the standard punch unit.
  51. C    I1MACH( 4) = the standard error message unit.
  52. C
  53. C  Words.
  54. C    I1MACH( 5) = the number of bits per integer storage unit.
  55. C    I1MACH( 6) = the number of characters per integer storage unit.
  56. C
  57. C  Integers.
  58. C    assume integers are represented in the S-digit, base-A form
  59. C
  60. C               sign ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) )
  61. C
  62. C               where 0 .LE. X(I) .LT. A for I=0,...,S-1.
  63. C    I1MACH( 7) = A, the base.
  64. C    I1MACH( 8) = S, the number of base-A digits.
  65. C    I1MACH( 9) = A**S - 1, the largest magnitude.
  66. C
  67. C  Floating-Point Numbers.
  68. C    Assume floating-point numbers are represented in the T-digit,
  69. C    base-B form
  70. C               sign (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
  71. C
  72. C               where 0 .LE. X(I) .LT. B for I=1,...,T,
  73. C               0 .LT. X(1), and EMIN .LE. E .LE. EMAX.
  74. C    I1MACH(10) = B, the base.
  75. C
  76. C  Single-Precision
  77. C    I1MACH(11) = T, the number of base-B digits.
  78. C    I1MACH(12) = EMIN, the smallest exponent E.
  79. C    I1MACH(13) = EMAX, the largest exponent E.
  80. C
  81. C  Double-Precision
  82. C    I1MACH(14) = T, the number of base-B digits.
  83. C    I1MACH(15) = EMIN, the smallest exponent E.
  84. C    I1MACH(16) = EMAX, the largest exponent E.
  85. C
  86. C  To alter this function for a particular environment,
  87. C  the desired set of DATA statements should be activated by
  88. C  removing the C from column 1.  Also, the values of
  89. C  I1MACH(1) - I1MACH(4) should be checked for consistency
  90. C  with the local operating system.
  91. C
  92. C***REFERENCES  FOX P.A., HALL A.D., SCHRYER N.L.,*FRAMEWORK FOR A
  93. C                 PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHEMATICAL
  94. C                 SOFTWARE, VOL. 4, NO. 2, JUNE 1978, PP. 177-188.
  95. C***ROUTINES CALLED  (NONE)
  96. C***END PROLOGUE  I1MACH
  97. C
  98.       INTEGER IMACH(16),OUTPUT
  99.       EQUIVALENCE (IMACH(4),OUTPUT)
  100. C
  101. C     MACHINE CONSTANTS FOR THE CRAY-1
  102. C
  103. c     DATA IMACH( 1) /   100 /
  104. c     DATA IMACH( 2) /   101 /
  105. c     DATA IMACH( 3) /   102 /
  106. c     DATA IMACH( 4) /   101 /
  107. c     DATA IMACH( 5) /    64 /
  108. c     DATA IMACH( 6) /     8 /
  109. c     DATA IMACH( 7) /     2 /
  110. c     DATA IMACH( 8) /    63 /
  111. c     DATA IMACH( 9) /  777777777777777777777B /
  112. c     DATA IMACH(10) /     2 /
  113. c     DATA IMACH(11) /    47 /
  114. c     DATA IMACH(12) / -8189 /
  115. c     DATA IMACH(13) /  8190 /
  116. c     DATA IMACH(14) /    94 /
  117. c     DATA IMACH(15) / -8099 /
  118. c     DATA IMACH(16) /  8190 /
  119. C
  120. ->
  121. ->    ->
  122. ->    ->    ->    Table #1 of 2
  123.  
  124. C     MACHINE CONSTANTS FOR THE indigo/MIPS    ????????????
  125.  
  126. C
  127. C     DATA IMACH( 1) /    /
  128. C     DATA IMACH( 2) /    /
  129. C     DATA IMACH( 3) /    /
  130. C     DATA IMACH( 4) /    /
  131. C     DATA IMACH( 5) /    /
  132. C     DATA IMACH( 6) /    /
  133. C     DATA IMACH( 7) /    /
  134. C     DATA IMACH( 8) /    /
  135. C     DATA IMACH( 9) /    /
  136. C     DATA IMACH(10) /    /
  137. C     DATA IMACH(11) /    /
  138. C     DATA IMACH(12) /    /
  139. C     DATA IMACH(13) /    /
  140. C     DATA IMACH(14) /    /
  141. C     DATA IMACH(15) /    /
  142. C     DATA IMACH(16) /    /
  143.                 <-    <-    <-
  144. C
  145. C
  146. C***FIRST EXECUTABLE STATEMENT  I1MACH
  147.       IF (I .LT. 1  .OR.  I .GT. 16) GO TO 10
  148. C
  149.       I1MACH = IMACH(I)
  150.       RETURN
  151. C
  152.    10 CONTINUE
  153.       WRITE (UNIT = OUTPUT, FMT = 9000)
  154.  9000 FORMAT ('1ERROR    1 IN I1MACH - I OUT OF BOUNDS')
  155. C
  156. C     CALL FDUMP
  157. C
  158. C
  159.       STOP
  160.       END
  161.  
  162.  
  163.  
  164.       REAL FUNCTION R1MACH(I)
  165. C***BEGIN PROLOGUE  R1MACH
  166. C***DATE WRITTEN   790101   (YYMMDD)
  167. C***REVISION DATE  870618   (YYMMDD)
  168. C***CATEGORY NO.  R1
  169. C***KEYWORDS  LIBRARY=SLATEC,TYPE=SINGLE PRECISION(R1MACH-S D1MACH-D),
  170. C             MACHINE CONSTANTS
  171. C***AUTHOR  FOX, P. A., (BELL LABS)
  172. C           HALL, A. D., (BELL LABS)
  173. C           SCHRYER, N. L., (BELL LABS)
  174. C***PURPOSE  Returns single precision machine dependent constants
  175. C***DESCRIPTION
  176. C
  177. C   R1MACH can be used to obtain machine-dependent parameters
  178. C   for the local machine environment.  It is a function
  179. C   subroutine with one (input) argument, and can be called
  180. C   as follows, for example
  181. C
  182. C        A = R1MACH(I)
  183. C
  184. C   where I=1,...,5.  The (output) value of A above is
  185. C   determined by the (input) value of I.  The results for
  186. C   various values of I are discussed below.
  187. C
  188. C   Single-Precision Machine Constants
  189. C   R1MACH(1) = B**(EMIN-1), the smallest positive magnitude.
  190. C   R1MACH(2) = B**EMAX*(1 - B**(-T)), the largest magnitude.
  191. C   R1MACH(3) = B**(-T), the smallest relative spacing.
  192. C   R1MACH(4) = B**(1-T), the largest relative spacing.
  193. C   R1MACH(5) = LOG10(B)
  194. C
  195. C   Assume single precision numbers are represented in the T-digit,
  196. C   base-B form
  197. C
  198. C              sign (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
  199. C
  200. C   where 0 .LE. X(I) .LT. B for I=1,...,T, 0 .LT. X(1), and
  201. C   EMIN .LE. E .LE. EMAX.
  202. C
  203. C   The values of B, T, EMIN and EMAX are provided in I1MACH as
  204. C   follows:
  205. C   I1MACH(10) = B, the base.
  206. C   I1MACH(11) = T, the number of base-B digits.
  207. C   I1MACH(12) = EMIN, the smallest exponent E.
  208. C   I1MACH(13) = EMAX, the largest exponent E.
  209. C
  210. C   To alter this function for a particular environment,
  211. C   the desired set of DATA statements should be activated by
  212. C   removing the C from column 1.  Also, the values of
  213. C   R1MACH(1) - R1MACH(4) should be checked for consistency
  214. C   with the local operating system.
  215. C
  216. C***REFERENCES  FOX, P.A., HALL, A.D., SCHRYER, N.L, *FRAMEWORK FOR
  217. C                 A PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHE-
  218. C                 MATICAL SOFTWARE, VOL. 4, NO. 2, JUNE 1978,
  219. C                 PP. 177-188.
  220. C***ROUTINES CALLED  XERROR
  221. C***END PROLOGUE  R1MACH
  222. C
  223.       INTEGER SMALL(2)
  224.       INTEGER LARGE(2)
  225.       INTEGER RIGHT(2)
  226.       INTEGER DIVER(2)
  227.       INTEGER LOG10(2)
  228. C
  229.       REAL RMACH(5)
  230. C
  231.       EQUIVALENCE (RMACH(1),SMALL(1))
  232.       EQUIVALENCE (RMACH(2),LARGE(1))
  233.       EQUIVALENCE (RMACH(3),RIGHT(1))
  234.       EQUIVALENCE (RMACH(4),DIVER(1))
  235.       EQUIVALENCE (RMACH(5),LOG10(1))
  236. C
  237. C     MACHINE CONSTANTS FOR THE CRAY-1
  238. C
  239. c     DATA RMACH(1) / 200034000000000000000B /
  240. c     DATA RMACH(2) / 577767777777777777776B /
  241. c     DATA RMACH(3) / 377224000000000000000B /
  242. c     DATA RMACH(4) / 377234000000000000000B /
  243. c     DATA RMACH(5) / 377774642023241175720B /
  244. c
  245. C
  246.  
  247. ->
  248. ->    ->
  249. ->    ->    ->    Table #2 of 2
  250.  
  251. C     MACHINE CONSTANTS FOR mips    ?????????????
  252. C
  253. C     DATA SMALL(1), SMALL(2) /    /
  254. C     DATA LARGE(1), LARGE(2) /    /
  255. C     DATA RIGHT(1), RIGHT(2) /    /
  256. C     DATA DIVER(1), DIVER(2) /    /
  257. C     DATA LOG10(1), LOG10(2) /    /
  258.                     <-    <-    <-
  259. C
  260. C
  261. C***FIRST EXECUTABLE STATEMENT  R1MACH
  262.       IF (I .LT. 1  .OR.  I .GT. 5)
  263.      1   CALL XERROR ('R1MACH -- I OUT OF BOUNDS', 25, 1, 2)
  264. C
  265.       R1MACH = RMACH(I)
  266.       RETURN
  267. C
  268.       END
  269.  
  270.  
  271.  
  272. Thanks.
  273.  
  274.     Patrick Nash
  275.     University of Texas at San Antonio
  276. email:    nsh@susan.ep.utsa.edu
  277. tel.:    (512) 691-4455
  278.