-
Notifications
You must be signed in to change notification settings - Fork 2
/
disp.3m_display.html
519 lines (509 loc) · 22.7 KB
/
disp.3m_display.html
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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<html>
<head>
<title> </title>
<style>
px {font-family: "Lucida Console", Monaco }
p { font-size:100%; line-height:1.1em; }
body {xfont-style: sans-serif}
body {
color:#333; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:1em; line-height:1.3em; }
a:visited { color:#666; }
h1,h2,h3,h4,h5,h6 { color:#333; font-family:georgia, verdana, sans-serif; }
h1 { font-size:150%; page-break-before:auto;background-color: #aaaaff}
h2 { font-size:143%;color:teal; }
h3 { font-size:134%;color:blue; }
h4 { font-size:120%;color:gray; }
img { max-width: 55em}
p{ padding: 0;margin:0; }
p{ padding-right:1.4em; }
p{ padding-bottom:1em; }
p{ padding-top:1em; }
p{ whitespace: pre-wrap; }
h5,h6 { font-size:100% }
a.nav,a:link.nav, a:visited.nav { background-color:#FFF; color:#000; }
XXtable { border:double #000; border-collapse:collapse; }
XXtable { border-collapse:collapse; }
XXtd { border:thin solid #888; }
XXtd { border:none; }
li { margin-bottom:0.5em; }
blockquote { display:block; font-size:100%; line-height:1.1em; margin:0 0 1.5em; padding:0 2.5em; }
pre { background-color:#DDD; font-size:100%; overflow:auto; padding:1em; }
a,li span { color:#000; }
a:hover, a.nav:hover, a:hover math { background-color:#000; color:#FFF; }
#Container { margin:0 10px; text-align:center; background-color: #BBB}
#Content { border-top:none; margin:auto; padding:0.3em; text-align:left; width:100%; max-width:55em; background:#FFF}
span.webName { font-size:.5em; }
textarea#content { font-size: 1em; line-height: 1.125; }
h1#pageName { line-height:1em; margin:0.2em 0 0.2em 0; padding:0; }
.property { color:#666; font-size:100%; }
a.existingWikiWord[title]{ //border: 1px dashed #BBB; }
.byline { color:#666; font-size:1.0em; font-style:italic; margin-bottom:1em; padding-top:1px; }
</style>
</head>
<BODY bgcolor=#F0F0F0 text=#000000 link=#0000ff vlink=#C000C0 alink=#ff0000><A NAME=top></A>
<h5><a href="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/urbanjost/M_display">[UP]</a></h5>
<div id="Container">
<div id="Content">
<CENTER>
<H1><HR><I>Manual Reference Pages - </I><NOBR>disp (3m_display)</NOBR><HR></H1>
</CENTER>
<A name=0>
<H3>NAME</H3>
</A>
<BLOCKQUOTE>
<B>disp</B>(3f) - [M_display] pretty-print a matrix
<P>
</BLOCKQUOTE>
<A name=contents></A><H3>CONTENTS</H3></A>
<BLOCKQUOTE>
<A HREF=#1>Description</A><BR>
<A HREF=#2>Call With Complete List Of Arguments</A><BR>
<A HREF=#3>Asterisk_unit And Null_unit</A><BR>
<A HREF=#4>Author</A><BR>
</BLOCKQUOTE>
<A name=5>
<H3>DESCRIPTION</H3>
</A>
<BLOCKQUOTE>
<P>
This is the principal subroutine of the package. It has various control arguments that specify the
exact format of the output. Most of these may also be used as arguments of the subroutine
DISP_SET. When used with DISP, a control argument affects only the item being displayed with the
current call, but when used with DISP_SET, the default settings for subsequent DISP calls are
affected. The default values for individual arguments given below are used unless they have been
changed by a call to DISP_SET. All character arguments should be of type default character.
<P>
Simple Calls:
<P>
<PRE>
call disp
call disp(x)
call disp(title, x)
call disp(x, fmt)
call disp(title, x, fmt)
<P>
</PRE>
The first call advances to the next line, and the other calls display X on the default unit (the
unit may be changed with the UNIT argument). The default putstrmodule (see section 2) sets the
asterisk unit (usually the screen) to be default. The purpose of individual arguments is as
follows:
<TABLE cellpadding=3><!-- tsb: The first call advances to the next line, and the other calls display X on the default unit (the
-->
<TR></TR><TR></TR>
<TR valign=top><TD width=6% nowrap>
<B>X</B> </TD><TD valign=bottom>
The item to be displayed. X may be scalar, vector or matrix (i.e. of rank <= 2) and the
following kinds of data are supported:
</TD></TR>
<TR><TD colspan=2>
<PRE>
default integer
default real (or single precision, real(kind(1.0)))
double precision real (or real(kind(1d0)))
default complex (or complex(kind(1.0)))
double precision complex (or complex(kind(1d0)))
default logical
default character
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
With the add-on modules described in section 2.3 other kinds may be displayed. Matrices are
displayed in traditional mathematical order, so the rows displayed are <B>X</B>(1,:), <B>X</B>(2,:) etc.
Vectors are by default displayed as column vectors (but a row orientation may be specified
with the ORIENT argument). An SS edit descriptor is applied automatically so positive
elements are not prefixed with a + sign (the Fortran standard makes outputting a + sign
optional).
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>TITLE</B> </TD><TD valign=bottom>
Provides a label for X. The label prefixes X by default but this may be changed with the
STYLE argument (see examples in section 3.2). When X is absent TITLE must also be absent.
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>FMT</B> </TD><TD valign=bottom>
When present, FMT should contain an edit descriptor that will be used to format each
element of X (or the real parts of X in case X is complex and FMT_IMAG is present; see
below). The possible edit descriptors are:
</TD></TR>
<TR><TD colspan=2>
<PRE>
Fw.d, Dw.d, Ew.dEe, ENw.dEe, ESw.dEe: real data (the Ee suffixes are optional)
Iw, Bw, Ow, Zw: integer data (all may be suffixed with .m)
Lw: logical data
A, Aw: character data
Gw.d, Gw.dEe: any data
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
Example calls for numeric X are CALL <B>DISP</B>(X,’ES11.4’) and CALL <B>DISP</B>(’X=’,X,’F8.4’). If X is
a scalar string (i.e. of rank 0) and TITLE is absent FMT must be specified with a keyword
(otherwise the call is taken to have TITLE and X): CALL <B>DISP</B>(’str’,FMT=’A4’) displays
"str" but CALL <B>DISP</B>(’str’,’A4’) displays "strA4").
<P>
If FMT is absent, each element of X is formatted with a default edit descriptor. When X is
of type logical the default is L1 and when it is of type character the default is A (which
is equivalent to Aw where w = <B>LEN</B>(X)). For integer data the default is Iw where w is
exactly big enough to accommodate both the largest positive and the largest negative values
in X. For real and complex data the default also depends on the largest absolute values in
X, as detailed in the DIGMAX-paragraph in section 3.2. The format used for complex numbers
is demonstrated in the introduction above.
</TD></TR>
<TR></TR></TABLE></BLOCKQUOTE>
<P>
<P>
<A name=2>
<H3>CALL WITH COMPLETE LIST OF ARGUMENTS</H3>
</A>
<BLOCKQUOTE>
<P>
CALL <B>DISP</B>(TITLE, X, FMT, FMT_IMAG, ADVANCE, DIGMAX, LBOUND, ORIENT,
SEP, STYLE, TRIM, UNIT, ZEROAS)
</BLOCKQUOTE>
<P>
All dummy arguments are optional and some of them are incompatible with some data types of X.
The arguments control how X is displayed, as described in section 3.1 and below. For the character
arguments ADVANCE and ORIENT the case of letters is ignored (so e.g. ADVANCE = ’yes’ and ADVANCE =
realized with argument keywords, e.g. CALL <B>DISP</B>(’X=’, X, DIGMAX=3, ORIENT=’ROW’). When X is a
scalar string FMT must also be associated with keyword, as mentioned in section 3.1. The most
useful application of calling DISP with X absent is to advance to the next line or display an
empty line. For this purpose, the only relevant arguments are UNIT, and ADVANCE with the value
<BLOCKQUOTE>
<TABLE cellpadding=3><!-- tsb: All dummy arguments are optional and some of them are incompatible with some data types of X.
-->
<TR></TR><TR></TR>
<TR valign=top><TD colspan=2>
<B>FMT_IMAG = edit-descriptor-imag</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
An edit descriptor for imaginary parts of complex X. The
statement CALL <B>DISP</B>((1.31,2.47),’F0.1’,’F0.2’) will display "1.3 + 2.47i". If FMT_IMAG
is absent and FMT is present then both real and imaginary parts are edited with FMT. If
both are absent, separate defaults are used, as explained in the DIGMAX-paragraph below.
FMT_IMAG must be absent if X is not complex.
</TD></TR>
<TR valign=top><TD colspan=2>
<B>ADVANCE = adv</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
The value for ADVANCE may be ’yes’, ’no’ or ’double’. If the value is ’yes’ then X
is written out immediately, if it is ’double’ then X is written out followed by an empty
line (thus giving double spacing), and if it is ’no’ then X is not written out until the
next DISP call on the same unit with advancing turned on (either by default, via a call to
DISP_SET, or via the ADVANCE keyword). When this occurs, all the items displayed with DISP
since the last output occurred on the unit are written out side by side, separated by three
spaces unless a different separation has been specified via the MATSEP argument of DISP_SET.
Default value of ADVANCE is ’yes’.
</TD></TR>
<TR valign=top><TD colspan=2>
<B>DIGMAX = n</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
Controls the format used for real and complex data in the absence of FMT. For real
items the format is chosen so that the displayed number of largest absolute magnitude (say
xmax) has n significant decimal digits. If 0.1 <= |xmax| < 10**n an F edit descriptor is
used, otherwise an E edit descriptor. For complex items these rules are applied separately
to the real parts and imaginary parts, and thus two different formats are used. When X is
not of real or complex type the argument DIGMAX is ignored. When DIGMAX is present FMT
should be absent. The default is n = 6.
</TD></TR>
<TR valign=top><TD colspan=2>
<B>LBOUND = lbound</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
This argument is a default integer vector with the numbers of the first row
/ column to show when displaying with numbered style. When calling subroutines in Fortran,
only the shape of matrix arguments is passed with the arguments, but matrix lower bounds are
assumed to be 1 unless declared explicitly in the routine. To compensate for this deficiency
LBOUND may be set to the declared lower <B>bound</B>(s) of X. To take an example, let
aij = <B>exp</B>(i + j - 1) as in section 1, but let A be declared with <B>REAL::A</B>(0:3,0:3). Then
CALL <B>DISP</B>(A, STYLE = ’NUMBER’, LBOUND = <B>LBOUND</B>(A)) will display:
</TD></TR>
<TR><TD colspan=2>
<PRE>
> 0 1 2 3
> 0 1.000 2.718 7.389 20.086
> 1 2.718 7.389 20.086 54.598
> 2 7.389 20.086 54.598 148.413
> 3 20.086 54.598 148.413 403.429.
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
In fact the call may be shortened to CALL <B>DISP</B>(A, LBOUND = <B>LBOUND</B>(A)) because numbering is
default when LBOUND is present.
</TD></TR>
<TR valign=top><TD colspan=2>
<B>ORIENT = ori</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
This argument can only be used when X is a vector (i.e. has rank 1). If ORIENT is
results.
</TD></TR>
<TR valign=top><TD colspan=2>
<B>SEP = sep</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
Specifies a string which is written out between columns of displayed matrices. If X has
rows (<B>-1</B>, 3) and (5, 10) and SEP is ’, ’ then the output will be:
</TD></TR>
<TR><TD colspan=2>
<PRE>
> -1, 5
> 5, 10
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
<TABLE width=100% cellpadding=3>
<TR valign=top><TD colspan=2>
<B>The length of the string must be at most 9. Default is ’</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
spaces).
</TD></TR>
<TR></TR></TABLE><!-- .TP -->
</TD></TR>
<TR valign=top><TD colspan=2>
<B>STYLE = style</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
There are five possible styles:
</TD></TR>
<TR><TD colspan=2>
<PRE>
’left’ Title is immediately to the left of the first line of the displayed item.
’above’ Title is centered immediately above the item.
’pad’ Title is centered above the item, padded with hyphens (-).
’underline’ Title is centered above the item, underlined with hyphens.
’number’ Each matrix or vector row and / or column is numbered.
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
Any of the four title position styles can also be combined with the number style by
specifying for example STYLE = ’pad & number’. Any character except space may be used
instead of hyphen by prefixing it to the style. STYLE = ’*underline’ will thus underline the
title with asterisks. Both row and column numbers appear for numbered matrices, but for
vectors only row numbers appear (or column numbers when ORIENT is ’col’). The five styles
are illustrated below, accompanied by an example of combined padded title and numbering.
<P>
<PRE>
> Matr = 1.2 4.2 Matr ---Matr-- Matr 1 2 ____Matr____
> 5.6 18.3 1.2 4.2 1.2 4.2 --------- 1 1.2 4.2 1 2
> 5.6 18.3 5.6 18.3 1.2 4.2 2 5.6 18.3 1 1.2 4.2
> 5.6 18.3 2 5.6 18.3
<P>
</PRE>
The default value of STYLE is ’left’ if LBOUND is absent, ’number’ if it is present, and
</TD></TR>
<TR valign=top><TD colspan=2>
<B>TRIM = trim</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
This argument can take three values, ’YES’, ’NO’ and ’AUTO’. When YES is specified,
each column of displayed items is trimmed from the left, with ’NO’ the items are not trimmed
and if TRIM is ’AUTO’ the items are trimmed when FMT is absent but not when it is present.
In the following example, X and U are displayed with TRIM = ’yes’, but Y and V with TRIM =
</TD></TR>
<TR><TD colspan=2>
<PRE>
> ----X---- -------Y------ -----U----- -------V------
> 1 2 4 1 2 3 333 22 4444 333 22 4444
> 2 22 34 2 22 34
> 3 32 1234 3 32 1234
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
One application of trimming is to display matrices with a fixed number of fractional digits
but variable effective field width. Then Fw.d editing with w big enough is accompanied by
TRIM = ’yes’. An example is the following display of a matrix with (i, k) element <B>exp</B>(k**i)
using F20.2 and ’yes’:
<P>
<PRE>
power exponentials
</PRE>
<TABLE width=100% cellpadding=3><!-- tsb: power exponentials
-->
<TR></TR><TR></TR>
<TR><TD width=6%> </TD><TD>
<TABLE width=100% cellpadding=3>
<TR valign=top><TD width=6% nowrap>
<B>2.72</B> </TD><TD valign=bottom>
7.39 20.09
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>2.72</B> </TD><TD valign=bottom>
54.60 8103.08
</TD></TR>
<TR></TR></TABLE></TD></TR>
<TR></TR></TABLE><!-- .PP -->
<P>
Similar output may be obtained using I and F edit descriptors with w = 0 as discussed in
section 3.5. Apart from I and F edited displays, it is possible to trim A-edited displays as
well as E-edited displays with some negative elements, but the first column all positive:
<P>
<PRE>
With TRIM=’yes’:X=1.2e+5 -4.1e-2 With TRIM=’no’:X= 1.2e+5 -4.1e-2
2.3e-3 8.6e+1 2.3e-3 8.6e+1
<P>
</PRE>
</TD></TR>
<TR valign=top><TD colspan=2>
<B>UNIT = external-file-unit</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
The unit which the output is sent to. There are three special units,
which may be referred to either with constants or parameters (named constants) as follows:
</TD></TR>
<TR><TD colspan=2>
<PRE>
Constant Parameter Preconnected unit
-3 ASTERISK_UNIT The asterisk unit (often the screen)
-2 PUTSTR_UNIT The subroutines PUTSTR and PUTNL
-1 NULL_UNIT Null device (all output to this is discarded)
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
These units are further described in sections 3.3 and 3.4. Other unit numbers correspond to
external files that should have been connected with open-statements. The default unit depends
on the named constant DEFAULT_UNIT, defined in PUTSTRMODULE. The default PUTSTRMODULE sets
it to <B>-3</B> (see sections 2 and 3.4).
</TD></TR>
<TR valign=top><TD colspan=2>
<B>ZEROAS = zerostring</B> </TD></TR><TR valign=top><TD width=6%> </TD><TD>
Supported for integer and real X (not complex) Any element that compares equal
to 0 will be displayed as zerostring. If, for example, A is a 4 by 4 upper triangular matrix
with aij = <B>1/max</B>(0,j - i + 1) then CALL <B>DISP</B>(’A = ’, A, ’F0.3’, ZEROAS = ’0’, ADVANCE = ’NO’)
and CALL <B>DISP</B>(’B = ’, A, ’F0.3’, ZEROAS = ’.’) will display:
</TD></TR>
<TR><TD colspan=2>
<PRE>
A = 1.000 0.500 0.333 0.250 B = 1.000 0.500 0.333 0.250
0 1.000 0.500 0.333 . 1.000 0.500 0.333
0 0 1.000 0.500 . . 1.000 0.500
0 0 0 1.000 . . . 1.000
<P>
</PRE>
</TD></TR>
<TR><TD width=6%> </TD><TD>
Notice that when zerostring contains a decimal point it is lined up with other decimal
points in the column. If zerostring has length 0, the default behavior of not treating zeros
specially is re-established, in case an earlier DISP_SET call has been used to set ZEROAS.
</TD></TR>
<TR></TR></TABLE></BLOCKQUOTE>
<P>
<P>
<A name=3>
<H3>ASTERISK_UNIT AND NULL_UNIT</H3>
</A>
<BLOCKQUOTE>
<P>
As already mentioned in section 3.2 there are three special units, ASTERISK_UNIT = <B>-3</B>, PUTSTR_UNIT
= <B>-2</B> and NULL_UNIT = <B>-1</B>. These public named constants (parameters) are defined by M_display.
<P>
Selecting ASTERISK_UNIT channels all output to the unit that <B>WRITE</B>(*,...) statements use. The
ISO_FORTRAN_ENV intrinsic module of Fortran 2003 defines the named constant OUTPUT_UNIT and this
may be used instead, unless its value is set to <B>-2</B> by the compiler (which would clash with
PUTSTR_UNIT).
<P>
Selecting NULL_UNIT causes all output via DISP to be discarded. This feature makes it simple to
turn the output on and off, which may be useful for debugging and testing purposes. If UNIT = U is
specified in all DISP-calls, it is enough to change the value of U to <B>-1</B> to turn off output.
</BLOCKQUOTE>
<P>
<P>
<BLOCKQUOTE>
PUTSTR_UNIT: Output with user written subroutines
<P>
One of the purposes of the PUTSTR_UNIT is to make displaying possible in situations where ordinary
print- and write-statements do not work. This is for example the case in Matlab mex-files (in fact
the execution of a write statement on the asterisk unit crashes Matlab). To use the PUTSTR_UNIT it
is necessary to write two subroutines with interfaces:
<P>
<PRE>
SUBROUTINE PUTSTR(S)
CHARACTER(*), INTENT(IN) :: S
<P>
SUBROUTINE PUTNL()
<P>
</PRE>
The first of these should output the string S, and the second one should advance output to the
next line. These subroutines should be placed in a module PUTSTRMODULE as explained in section 2.
The module should also define a named constant DEFAULT_UNIT, which could be set to <B>-2</B> to make the
PUTSTR_UNIT default. An example that works with g95 and Matlab mex-files is:
<P>
<PRE>
module putstrmodule
integer, parameter :: default_unit = -2
<P>
contains
subroutine putstr(s)
character(*), intent(in) :: s
call mexprintf(s//char(0))
end subroutine putstr
<P>
subroutine putnl()
call mexprintf(char(10)//char(0))
end subroutine putnl
<P>
end module putstrmodule
<P>
</PRE>
At the beginning of the file M_display.f90 there is a slightly longer version which works with
both g95 and gfortran. Testing this module is discussed in section 6.2 below.
</BLOCKQUOTE>
<P>
<P>
<BLOCKQUOTE>
USING W=0 EDITING
<P>
The Fortran standard stipulates that writing a single element with I0 editing results in the
smallest field width that accommodates the value, and the same applies to B0, O0, Z0 and F0.d
editing. With DISP, the width of a displayed column will be the width of the widest field in the
column, and each element is right-adjusted in the column. This gives exactly the same output as
using TRIM=’yes’ and a specified field width bigger than the largest occurring. Note that with
F0.d editing, there is no limit on the width of a column, but with Fw.d and TRIM=’yes’ any element
wider than w will be displayed as w asterisks:
<P>
<PRE>
------------------F0.2------------------ -----F13.2, TRIM=’yes’----
14.28 142857142857142857142857.14 0.47 14.28 ************* 0.47
1.42 1414213562.37 0.69 1.42 1414213562.37 0.69
<P>
<P>
</PRE>
NOT-A-NUMBER AND INFINITE VALUES
<P>
If the compiler supports not-a-number and infinite values as defined by the IEEE exceptional values
of Fortran 2003, these are displayed as NaN, +Inf or Inf. A not-a-number value X is identified as
being not equal to itself, and an infinite value is either greater than <B>HUGE</B>(X) or smaller than
-<B>HUGE</B>(X). On all the compilers tried the sequence BIG=1E20; CALL <B>DISP</B>(EXP(BIG)) displays +Inf, and
the program segment:
<P>
<PRE>
> real :: z = 0, big = 1e20
> call disp([z, z/z, big, -exp(big)])
<P>
</PRE>
displays
<BLOCKQUOTE>
<TABLE cellpadding=3><!-- tsb: displays
-->
<TR></TR><TR></TR>
<TR valign=top><TD width=6% nowrap>
<B>></B> </TD><TD valign=bottom>
0.00000E+00
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>></B> </TD><TD valign=bottom>
NaN
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>></B> </TD><TD valign=bottom>
1.00000E+20
</TD></TR>
<TR valign=top><TD width=6% nowrap>
<B>></B> </TD><TD valign=bottom>
<B>-Inf</B>
</TD></TR>
<TR></TR></TABLE></BLOCKQUOTE>
</BLOCKQUOTE>
<A name=4>
<H3>AUTHOR</H3>
</A>
<BLOCKQUOTE>
Based on <B>dispmodule</B>(3f), "A Fortran 95 module for pretty-printing matrices".
Version number 1.02 6-Sept-2008, Kristjan Jonasson, Dept. of Computer Science, University of
Iceland (<A HREF="mailto:[email protected]">[email protected]</A>).
</BLOCKQUOTE>
<P><HR>
<TABLE width=100%><TR> <TD width=33%><I></I></TD> <TD width=33% align=center>disp (3m_display)</TD> <TD align=right width=33%><I>October 02, 2021</I></TD> </TR></TABLE><FONT SIZE=-1>Generated by <A HREF="http:https://www.squarebox.co.uk/download/manServer.shtml">manServer 1.08</A> from 80cf0b73-baff-462d-b5d7-6df5c5b15777 using man macros.</FONT>
<br><br><center><img src="images/disp.gif"></center>
</div>
</div>
</body>
</HTML>