home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!swrinde!ringer!lonestar.utsa.edu!nashpl
- From: nashpl@lonestar.utsa.edu (Patrick L. Nash)
- Newsgroups: comp.sys.sgi
- Subject: Machine Constants for indigo/mips
- Message-ID: <1992Sep8.115050.29330@ringer.cs.utsa.edu>
- Date: 8 Sep 92 11:50:50 GMT
- Sender: news@ringer.cs.utsa.edu
- Distribution: na
- Organization: University of Texas at San Antonio
- Lines: 265
- Nntp-Posting-Host: lonestar.utsa.edu
-
-
- MACHINE CONSTANTS FOR THE indigo/MIPS are needed before one can use the slatec
- libraries (which can be obtained via anon ftp from ncar.ucar.edu). If anyone
- knows the values needed to fill in the two 'tables' marked below,
- could you email them to me?
-
- Your help is greatly appreciated.
-
-
-
-
- INTEGER FUNCTION I1MACH(I)
- C***BEGIN PROLOGUE I1MACH
- C***DATE WRITTEN 750101 (YYMMDD)
- C***REVISION DATE 870618 (YYMMDD)
- C***CATEGORY NO. R1
- C***KEYWORDS LIBRARY=SLATEC,TYPE=INTEGER(I1MACH-I),MACHINE CONSTANTS
- C***AUTHOR FOX, P. A., (BELL LABS)
- C HALL, A. D., (BELL LABS)
- C SCHRYER, N. L., (BELL LABS)
- C***PURPOSE Returns integer machine dependent constants
- C***DESCRIPTION
- C
- C I1MACH can be used to obtain machine-dependent parameters
- C for the local machine environment. It is a function
- C subroutine with one (input) argument, and can be called
- C as follows, for example
- C
- C K = I1MACH(I)
- C
- C where I=1,...,16. The (output) value of K above is
- C determined by the (input) value of I. The results for
- C various values of I are discussed below.
- C
- C I/O unit numbers.
- C I1MACH( 1) = the standard input unit.
- C I1MACH( 2) = the standard output unit.
- C I1MACH( 3) = the standard punch unit.
- C I1MACH( 4) = the standard error message unit.
- C
- C Words.
- C I1MACH( 5) = the number of bits per integer storage unit.
- C I1MACH( 6) = the number of characters per integer storage unit.
- C
- C Integers.
- C assume integers are represented in the S-digit, base-A form
- C
- C sign ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) )
- C
- C where 0 .LE. X(I) .LT. A for I=0,...,S-1.
- C I1MACH( 7) = A, the base.
- C I1MACH( 8) = S, the number of base-A digits.
- C I1MACH( 9) = A**S - 1, the largest magnitude.
- C
- C Floating-Point Numbers.
- C Assume floating-point numbers are represented in the T-digit,
- C base-B form
- C sign (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
- C
- C where 0 .LE. X(I) .LT. B for I=1,...,T,
- C 0 .LT. X(1), and EMIN .LE. E .LE. EMAX.
- C I1MACH(10) = B, the base.
- C
- C Single-Precision
- C I1MACH(11) = T, the number of base-B digits.
- C I1MACH(12) = EMIN, the smallest exponent E.
- C I1MACH(13) = EMAX, the largest exponent E.
- C
- C Double-Precision
- C I1MACH(14) = T, the number of base-B digits.
- C I1MACH(15) = EMIN, the smallest exponent E.
- C I1MACH(16) = EMAX, the largest exponent E.
- C
- C To alter this function for a particular environment,
- C the desired set of DATA statements should be activated by
- C removing the C from column 1. Also, the values of
- C I1MACH(1) - I1MACH(4) should be checked for consistency
- C with the local operating system.
- C
- C***REFERENCES FOX P.A., HALL A.D., SCHRYER N.L.,*FRAMEWORK FOR A
- C PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHEMATICAL
- C SOFTWARE, VOL. 4, NO. 2, JUNE 1978, PP. 177-188.
- C***ROUTINES CALLED (NONE)
- C***END PROLOGUE I1MACH
- C
- INTEGER IMACH(16),OUTPUT
- EQUIVALENCE (IMACH(4),OUTPUT)
- C
- C MACHINE CONSTANTS FOR THE CRAY-1
- C
- c DATA IMACH( 1) / 100 /
- c DATA IMACH( 2) / 101 /
- c DATA IMACH( 3) / 102 /
- c DATA IMACH( 4) / 101 /
- c DATA IMACH( 5) / 64 /
- c DATA IMACH( 6) / 8 /
- c DATA IMACH( 7) / 2 /
- c DATA IMACH( 8) / 63 /
- c DATA IMACH( 9) / 777777777777777777777B /
- c DATA IMACH(10) / 2 /
- c DATA IMACH(11) / 47 /
- c DATA IMACH(12) / -8189 /
- c DATA IMACH(13) / 8190 /
- c DATA IMACH(14) / 94 /
- c DATA IMACH(15) / -8099 /
- c DATA IMACH(16) / 8190 /
- C
- ->
- -> ->
- -> -> -> Table #1 of 2
-
- C MACHINE CONSTANTS FOR THE indigo/MIPS ????????????
-
- C
- C DATA IMACH( 1) / /
- C DATA IMACH( 2) / /
- C DATA IMACH( 3) / /
- C DATA IMACH( 4) / /
- C DATA IMACH( 5) / /
- C DATA IMACH( 6) / /
- C DATA IMACH( 7) / /
- C DATA IMACH( 8) / /
- C DATA IMACH( 9) / /
- C DATA IMACH(10) / /
- C DATA IMACH(11) / /
- C DATA IMACH(12) / /
- C DATA IMACH(13) / /
- C DATA IMACH(14) / /
- C DATA IMACH(15) / /
- C DATA IMACH(16) / /
- <- <- <-
- C
- C
- C***FIRST EXECUTABLE STATEMENT I1MACH
- IF (I .LT. 1 .OR. I .GT. 16) GO TO 10
- C
- I1MACH = IMACH(I)
- RETURN
- C
- 10 CONTINUE
- WRITE (UNIT = OUTPUT, FMT = 9000)
- 9000 FORMAT ('1ERROR 1 IN I1MACH - I OUT OF BOUNDS')
- C
- C CALL FDUMP
- C
- C
- STOP
- END
-
-
-
- REAL FUNCTION R1MACH(I)
- C***BEGIN PROLOGUE R1MACH
- C***DATE WRITTEN 790101 (YYMMDD)
- C***REVISION DATE 870618 (YYMMDD)
- C***CATEGORY NO. R1
- C***KEYWORDS LIBRARY=SLATEC,TYPE=SINGLE PRECISION(R1MACH-S D1MACH-D),
- C MACHINE CONSTANTS
- C***AUTHOR FOX, P. A., (BELL LABS)
- C HALL, A. D., (BELL LABS)
- C SCHRYER, N. L., (BELL LABS)
- C***PURPOSE Returns single precision machine dependent constants
- C***DESCRIPTION
- C
- C R1MACH can be used to obtain machine-dependent parameters
- C for the local machine environment. It is a function
- C subroutine with one (input) argument, and can be called
- C as follows, for example
- C
- C A = R1MACH(I)
- C
- C where I=1,...,5. The (output) value of A above is
- C determined by the (input) value of I. The results for
- C various values of I are discussed below.
- C
- C Single-Precision Machine Constants
- C R1MACH(1) = B**(EMIN-1), the smallest positive magnitude.
- C R1MACH(2) = B**EMAX*(1 - B**(-T)), the largest magnitude.
- C R1MACH(3) = B**(-T), the smallest relative spacing.
- C R1MACH(4) = B**(1-T), the largest relative spacing.
- C R1MACH(5) = LOG10(B)
- C
- C Assume single precision numbers are represented in the T-digit,
- C base-B form
- C
- C sign (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
- C
- C where 0 .LE. X(I) .LT. B for I=1,...,T, 0 .LT. X(1), and
- C EMIN .LE. E .LE. EMAX.
- C
- C The values of B, T, EMIN and EMAX are provided in I1MACH as
- C follows:
- C I1MACH(10) = B, the base.
- C I1MACH(11) = T, the number of base-B digits.
- C I1MACH(12) = EMIN, the smallest exponent E.
- C I1MACH(13) = EMAX, the largest exponent E.
- C
- C To alter this function for a particular environment,
- C the desired set of DATA statements should be activated by
- C removing the C from column 1. Also, the values of
- C R1MACH(1) - R1MACH(4) should be checked for consistency
- C with the local operating system.
- C
- C***REFERENCES FOX, P.A., HALL, A.D., SCHRYER, N.L, *FRAMEWORK FOR
- C A PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHE-
- C MATICAL SOFTWARE, VOL. 4, NO. 2, JUNE 1978,
- C PP. 177-188.
- C***ROUTINES CALLED XERROR
- C***END PROLOGUE R1MACH
- C
- INTEGER SMALL(2)
- INTEGER LARGE(2)
- INTEGER RIGHT(2)
- INTEGER DIVER(2)
- INTEGER LOG10(2)
- C
- REAL RMACH(5)
- C
- EQUIVALENCE (RMACH(1),SMALL(1))
- EQUIVALENCE (RMACH(2),LARGE(1))
- EQUIVALENCE (RMACH(3),RIGHT(1))
- EQUIVALENCE (RMACH(4),DIVER(1))
- EQUIVALENCE (RMACH(5),LOG10(1))
- C
- C MACHINE CONSTANTS FOR THE CRAY-1
- C
- c DATA RMACH(1) / 200034000000000000000B /
- c DATA RMACH(2) / 577767777777777777776B /
- c DATA RMACH(3) / 377224000000000000000B /
- c DATA RMACH(4) / 377234000000000000000B /
- c DATA RMACH(5) / 377774642023241175720B /
- c
- C
-
- ->
- -> ->
- -> -> -> Table #2 of 2
-
- C MACHINE CONSTANTS FOR mips ?????????????
- C
- C DATA SMALL(1), SMALL(2) / /
- C DATA LARGE(1), LARGE(2) / /
- C DATA RIGHT(1), RIGHT(2) / /
- C DATA DIVER(1), DIVER(2) / /
- C DATA LOG10(1), LOG10(2) / /
- <- <- <-
- C
- C
- C***FIRST EXECUTABLE STATEMENT R1MACH
- IF (I .LT. 1 .OR. I .GT. 5)
- 1 CALL XERROR ('R1MACH -- I OUT OF BOUNDS', 25, 1, 2)
- C
- R1MACH = RMACH(I)
- RETURN
- C
- END
-
-
-
- Thanks.
-
- Patrick Nash
- University of Texas at San Antonio
- email: nsh@susan.ep.utsa.edu
- tel.: (512) 691-4455
-