File: truncation.html

package info (click to toggle)
ftnchek 2.11.2-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,392 kB
  • ctags: 2,790
  • sloc: ansic: 21,570; fortran: 2,921; yacc: 2,794; sh: 1,623; makefile: 693; lisp: 264; awk: 163
file content (94 lines) | stat: -rw-r--r-- 4,135 bytes parent folder | download
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
<HTML>
<HEAD>
<TITLE>Option: truncation</TITLE>
</HEAD>
<BODY>
<A HREF="toc.html">Table of Contents</A><P>
<P>Previous: <A HREF="symtab.html">-symtab</A><HR><P>
<H2>Option: <font color=#FF0080>truncation</font></H2><P>
<A NAME="truncation"></A><DT><B><A HREF="truncation.html">-truncation</A>=</B><I>list</I> 
 </DT>
<DD>Warn about possible truncation (or roundoff) errors.  Most of these are 
related to integer arithmetic.  By default, all warnings are turned on. 
 <blockquote></DD>
</DL>
<P>
This setting provides detailed control over the warnings about possible 
truncation errors.  The <I>list </I> consists of keywords separated by commas 
or colons. Since all warnings are on by default, include a keyword prefixed 
by <B>no- </B> to turn off a particular warning. There are three special keywords: 
<B>all </B> to turn on all the warnings about truncation, <B>none </B> to turn them 
all off, and <B>help </B> to print the list of all the keywords with a brief 
explanation of each. If <I>list </I> is omitted, <B><A HREF="truncation.html">-truncation</A> </B> is equivalent to 
<B><A HREF="truncation.html">-truncation</A>=all </B>, and <B>-notruncation </B> is equivalent to <B><A HREF="truncation.html">-truncation</A>=none </B>. The 
warning keywords with their meanings are as follows: 
<DL>

<DT><B>int-div-exponent</B>:  
</DT>
<DD>use of the result of integer division as an exponent. This suggests that 
a real quotient is intended. An example would be writing X**(1/3)  to evaluate 
the cube root of X . The correct expression is X**(1./3.) . </DD>

<DT><B>int-div-real</B>:  </DT>
<DD>Conversion 
of an expression involving an integer division to real. This suggests that 
a real quotient is intended. </DD>

<DT><B>int-div-zero</B>:  </DT>
<DD>division in an integer constant 
expression that yields a result of zero. </DD>

<DT><B>int-neg-power</B>:  </DT>
<DD>exponentiation of 
an integer by a negative integer (which yields zero unless the base integer 
is 1 in magnitude). This suggests that a real base is intended. </DD>

<DT><B>promotion</B>: 
 </DT>
<DD>automatic conversion of a lower precision quantity to one of higher precision. 
 The loss of accuracy for real variables in this process is comparable 
to the corresponding demotion.  No warning is given for promotion of integer 
quantities to real since this is ordinarily exact. </DD>

<DT><B>real-do-index</B>:  </DT>
<DD>use of 
a non-integer DO index in a loop with integer bounds. An integer DO index 
with real bounds is always warned about regardless of this setting. </DD>

<DT><B>real-subscript</B>: 
 </DT>
<DD>use of a non-integer array subscript. </DD>

<DT><B>significant-figures</B>:  </DT>
<DD>overspecifying 
a single precision constant.  This may indicate that a double precision 
constant was intended. </DD>

<DT><B>size-demotion</B>:  </DT>
<DD>automatic conversion of a higher 
precision quantity to one of lower precision of the same type.  This warning 
only occurs when an explicit size is used in declaring the type of one 
or both operands in an assignment.  For example, a warning wil be issued 
where a REAL*8  variable is assigned to a REAL  variable, if the default 
wordsize of 4 is in effect. <B>type-demotion</B>: automatic conversion of a higher 
precision quantity to one of lower precision of different type.  This warning 
includes conversion of real quantities to integer, double precision to 
single precision real, and assignment of a longer character string to 
a shorter one. </DD>
</DL>
<P>
The warnings about promotion and demotion also apply to 
complex constants, considering the precision to be that of the real or 
imaginary part. Warnings about promotions and demotions are given only 
when the conversion is done automatically, e.g. in expressions of mixed 
precision or in an assignment statement.  If intrinsic functions such as 
INT  are used to perform the conversion, no warning is given. <P>
See also: 
<B><A HREF="portability.html">-portability</A> </B>, <B><A HREF="wordsize.html">-wordsize</A> </B>.  </blockquote>
<P>
 
<DL>

<P><HR><P>Next: <A HREF="usage.html">-usage</A>
</BODY></HTML>