File: i1mach.c

package info (click to toggle)
mixviews 1.10-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,440 kB
  • ctags: 6,314
  • sloc: cpp: 31,647; ansic: 2,100; makefile: 1,782; sh: 17
file content (431 lines) | stat: -rw-r--r-- 12,478 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
/******************************************************************************
 *
 *  MiXViews - an X window system based sound & data editor/processor
 *
 *  Copyright (c) 1993, 1994 Regents of the University of California
 *
 *  Author:     Douglas Scott
 *  Date:       December 13, 1994
 *
 *  Permission to use, copy and modify this software and its documentation
 *  for research and/or educational purposes and without fee is hereby granted,
 *  provided that the above copyright notice appear in all copies and that
 *  both that copyright notice and this permission notice appear in
 *  supporting documentation. The author reserves the right to distribute this
 *  software and its documentation.  The University of California and the author
 *  make no representations about the suitability of this software for any 
 *  purpose, and in no event shall University of California be liable for any
 *  damage, loss of data, or profits resulting from its use.
 *  It is provided "as is" without express or implied warranty.
 *
 ******************************************************************************/

/* i1mach.f -- translated by f2c (version of 16 February 1991  0:35:15).
   You must link the resulting object file with the libraries:
	-lf2c -lm -lc   (in that order)
*/

#include "f2c.h"


/* ---------------------------------------------------------------------- */
/*  function:  i1mach */
/*  this routine is from the port mathematical subroutine library */
/*  it is described in the bell laboratories computing science */
/*  technical report #47 by p.a. fox, a.d. hall and n.l. schryer */
/* --------------------------------------------------------------------- */

integer i1mach_(i)
integer *i;
{
    /* Initialized data */

    static struct {
	integer e_1[16];
	} equiv_0 = { { 5, 6, 5, 6, 32, 4, 2, 31, 2147483647, 2, 24, -127, 127, 
		56, -127, 127}  };


    /* Format strings */
    static char fmt_9000[] = "(\0021error    1 in i1mach - i out of bound\
s\002)";

    /* System generated locals */
    integer ret_val;

    /* Builtin functions */
    integer s_wsfe(), e_wsfe();
    /* Subroutine */ int s_stop();

    /* Local variables */
#define imach ((integer *)&equiv_0)
#define output ((integer *)&equiv_0 + 3)

    /* Fortran I/O blocks */
    static cilist io___3 = { 0, 0, 0, fmt_9000, 0 };



/*  i/o unit numbers. */

/*    i1mach( 1) = the standard input unit. */

/*    i1mach( 2) = the standard output unit. */

/*    i1mach( 3) = the standard punch unit. */

/*    i1mach( 4) = the standard error message unit. */

/*  words. */

/*    i1mach( 5) = the number of bits per integer storage unit. */

/*    i1mach( 6) = the number of characters per integer storage unit. */

/*  integers. */

/*    assume integers are represented in the s-digit, base-a form */

/* 		   sign ( x(s-1)*a**(s-1) + ... + x(1)*a + x(0) ) */

/* 		   where 0 .le. x(i) .lt. a for i=0,...,s-1. */

/*    i1mach( 7) = a, the base. */

/*    i1mach( 8) = s, the number of base-a digits. */

/*    i1mach( 9) = a**s - 1, the largest magnitude. */

/*  floating-point numbers. */

/*    assume floating-point numbers are represented in the t-digit, */
/*    base-b form */

/* 		   sign (b**e)*( (x(1)/b) + ... + (x(t)/b**t) ) */

/* 		   where 0 .le. x(i) .lt. b for i=1,...,t, */
/* 		   0 .lt. x(1), and emin .le. e .le. emax. */

/*    i1mach(10) = b, the base. */

/*  single-precision */

/*    i1mach(11) = t, the number of base-b digits. */

/*    i1mach(12) = emin, the smallest exponent e. */

/*    i1mach(13) = emax, the largest exponent e. */

/*  double-precision */

/*    i1mach(14) = t, the number of base-b digits. */

/*    i1mach(15) = emin, the smallest exponent e. */

/*    i1mach(16) = emax, the largest exponent e. */

/*  to alter this function for a particular environment, */
/*  the desired set of data statements should be activated by */
/*  removing the c from column 1.  also, the values of */
/*  i1mach(1) - i1mach(4) should be checked for consistency */
/*  with the local operating system. */



/* 	machine constants for the burroughs 1700 system. */

/* 	data imach( 1) /    7 / */
/* 	data imach( 2) /    2 / */
/* 	data imach( 3) /    2 / */
/* 	data imach( 4) /    2 / */
/* 	data imach( 5) /   36 / */
/* 	data imach( 6) /    4 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   33 / */
/* 	data imach( 9) / z1ffffffff / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   24 / */
/* 	data imach(12) / -256 / */
/* 	data imach(13) /  255 / */
/* 	data imach(14) /   60 / */
/* 	data imach(15) / -256 / */
/* 	data imach(16) /  255 / */

/* 	machine constants for the burroughs 5700 system. */

/* 	data imach( 1) /   5 / */
/* 	data imach( 2) /   6 / */
/* 	data imach( 3) /   7 / */
/* 	data imach( 4) /   6 / */
/* 	data imach( 5) /  48 / */
/* 	data imach( 6) /   6 / */
/* 	data imach( 7) /   2 / */
/* 	data imach( 8) /  39 / */
/* 	data imach( 9) / o0007777777777777 / */
/* 	data imach(10) /   8 / */
/* 	data imach(11) /  13 / */
/* 	data imach(12) / -50 / */
/* 	data imach(13) /  76 / */
/* 	data imach(14) /  26 / */
/* 	data imach(15) / -50 / */
/* 	data imach(16) /  76 / */

/* 	machine constants for the burroughs 6700/7700 systems. */

/* 	data imach( 1) /   5 / */
/* 	data imach( 2) /   6 / */
/* 	data imach( 3) /   7 / */
/* 	data imach( 4) /   6 / */
/* 	data imach( 5) /  48 / */
/* 	data imach( 6) /   6 / */
/* 	data imach( 7) /   2 / */
/* 	data imach( 8) /  39 / */
/* 	data imach( 9) / o0007777777777777 / */
/* 	data imach(10) /   8 / */
/* 	data imach(11) /  13 / */
/* 	data imach(12) / -50 / */
/* 	data imach(13) /  76 / */
/* 	data imach(14) /  26 / */
/* 	data imach(15) / -32754 / */
/* 	data imach(16) /  32780 / */

/* 	machine constants for the cdc 6000/7000 series. */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    7 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   60 / */
/* 	data imach( 6) /   10 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   48 / */
/* 	data imach( 9) / 00007777777777777777b / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   48 / */
/* 	data imach(12) / -974 / */
/* 	data imach(13) / 1070 / */
/* 	data imach(14) /   96 / */
/* 	data imach(15) / -927 / */
/* 	data imach(16) / 1070 / */

/* 	machine constants for the cray 1 */

/* 	data imach( 1) /   100 / */
/* 	data imach( 2) /   101 / */
/* 	data imach( 3) /   102 / */
/* 	data imach( 4) /   101 / */
/* 	data imach( 5) /    64 / */
/* 	data imach( 6) /	8 / */
/* 	data imach( 7) /	2 / */
/* 	data imach( 8) /    63 / */
/* 	data imach( 9) /  777777777777777777777b / */
/* 	data imach(10) /	2 / */
/* 	data imach(11) /    47 / */
/* 	data imach(12) / -8192 / */
/* 	data imach(13) /  8190 / */
/* 	data imach(14) /    95 / */
/* 	data imach(15) / -8192 / */
/* 	data imach(16) /  8190 / */

/* 	machine constants for the data general eclipse s/200 */

/* 	data imach( 1) /   11 / */
/* 	data imach( 2) /   12 / */
/* 	data imach( 3) /    8 / */
/* 	data imach( 4) /   10 / */
/* 	data imach( 5) /   16 / */
/* 	data imach( 6) /    2 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   15 / */
/* 	data imach( 9) /32767 / */
/* 	data imach(10) /   16 / */
/* 	data imach(11) /    6 / */
/* 	data imach(12) /  -64 / */
/* 	data imach(13) /   63 / */
/* 	data imach(14) /   14 / */
/* 	data imach(15) /  -64 / */
/* 	data imach(16) /   63 / */

/* 	machine constants for the harris slash 6 and slash 7 */

/* 	data imach( 1) /	 5 / */
/* 	data imach( 2) /	 6 / */
/* 	data imach( 3) /	 0 / */
/* 	data imach( 4) /	 6 / */
/* 	data imach( 5) /	24 / */
/* 	data imach( 6) /	 3 / */
/* 	data imach( 7) /	 2 / */
/* 	data imach( 8) /	23 / */
/* 	data imach( 9) / 8388607 / */
/* 	data imach(10) /	 2 / */
/* 	data imach(11) /	23 / */
/* 	data imach(12) /    -127 / */
/* 	data imach(13) /	127 / */
/* 	data imach(14) /	38 / */
/* 	data imach(15) /    -127 / */
/* 	data imach(16) /	127 / */

/* 	machine constants for the honeywell 600/6000 series. */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /   43 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   36 / */
/* 	data imach( 6) /    6 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   35 / */
/* 	data imach( 9) / o377777777777 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   27 / */
/* 	data imach(12) / -127 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   63 / */
/* 	data imach(15) / -127 / */
/* 	data imach(16) /  127 / */

/* 	machine constants for the ibm 360/370 series, */
/* 	the xerox sigma 5/7/9 and the sel systems 85/86. */

/* 	data imach( 1) /   5 / */
/* 	data imach( 2) /   6 / */
/* 	data imach( 3) /   7 / */
/* 	data imach( 4) /   6 / */
/* 	data imach( 5) /  32 / */
/* 	data imach( 6) /   4 / */
/* 	data imach( 7) /   2 / */
/* 	data imach( 8) /  31 / */
/* 	data imach( 9) / z7fffffff / */
/* 	data imach(10) /  16 / */
/* 	data imach(11) /   6 / */
/* 	data imach(12) / -64 / */
/* 	data imach(13) /  63 / */
/* 	data imach(14) /  14 / */
/* 	data imach(15) / -64 / */
/* 	data imach(16) /  63 / */

/* 	machine constants for the pdp-10 (ka processor). */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    5 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   36 / */
/* 	data imach( 6) /    5 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   35 / */
/* 	data imach( 9) / "377777777777 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   27 / */
/* 	data imach(12) / -128 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   54 / */
/* 	data imach(15) / -101 / */
/* 	data imach(16) /  127 / */

/* 	machine constants for the pdp-10 (ki processor). */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    5 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   36 / */
/* 	data imach( 6) /    5 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   35 / */
/* 	data imach( 9) / "377777777777 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   27 / */
/* 	data imach(12) / -128 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   62 / */
/* 	data imach(15) / -128 / */
/* 	data imach(16) /  127 / */

/* 	machine constants for pdp-11 fortran supporting */
/* 	32-bit integer arithmetic. */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    5 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   32 / */
/* 	data imach( 6) /    4 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   31 / */
/* 	data imach( 9) / 2147483647 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   24 / */
/* 	data imach(12) / -127 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   56 / */
/* 	data imach(15) / -127 / */
/* 	data imach(16) /  127 / */

/* 	machine constants for pdp-11 fortran supporting */
/* 	16-bit integer arithmetic. */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    5 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   16 / */
/* 	data imach( 6) /    2 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   15 / */
/* 	data imach( 9) / 32767 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   24 / */
/* 	data imach(12) / -127 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   56 / */
/* 	data imach(15) / -127 / */
/* 	data imach(16) /  127 / */

/* 	machine constants for the univac 1100 series. */

/* 	note that the punch unit, i1mach(3), has been set to 7 */
/* 	which is appropriate for the univac-for system. */
/* 	if you have the univac-ftn system, set it to 1. */

/* 	data imach( 1) /    5 / */
/* 	data imach( 2) /    6 / */
/* 	data imach( 3) /    7 / */
/* 	data imach( 4) /    6 / */
/* 	data imach( 5) /   36 / */
/* 	data imach( 6) /    6 / */
/* 	data imach( 7) /    2 / */
/* 	data imach( 8) /   35 / */
/* 	data imach( 9) / o377777777777 / */
/* 	data imach(10) /    2 / */
/* 	data imach(11) /   27 / */
/* 	data imach(12) / -128 / */
/* 	data imach(13) /  127 / */
/* 	data imach(14) /   60 / */
/* 	data imach(15) /-1024 / */
/* 	data imach(16) / 1023 / */

/* 	machine constants for the vax-11 with */
/* 	fortran iv-plus compiler */


    if (*i < 1 || *i > 16) {
	goto L10;
    }

    ret_val = imach[*i - 1];
    return ret_val;

L10:
    io___3.ciunit = *output;
    s_wsfe(&io___3);
    e_wsfe();

    s_stop("", 0L);

} /* i1mach_ */

#undef output
#undef imach