<br><tt><font size=2>j3-bounces@j3-fortran.org wrote on 10/27/2008 04:50:33
PM:<br>
<br>
> ><br>
> > This discussion originally came from C community on INT_MIN %
(-1). <br>
> > Say you have a minimum integer value, INT_MIN (e.g. -HUGE(1)
- 1), <br>
> > then is it a legal Fortran code to compute MOD(INT_MIN, -1)?<br>
> <br>
> Is INT_MIN the same as -huge( 0) ?<br>
> <br>
> Is mod() the same as % ?<br>
> ><br>
> ><br>
> > Based on the text in 13.7.80 of F03, MOD(A,P) is interpreted
as A - <br>
> > INT ( A / P) * P. This expression applied on MOD(INT_MIN,
-1) will <br>
> > result in a computation of INT_MIN / (-1), which overflows.<br>
> <br>
> Does is overflow as per the standard,<br>
> or just in some implementations?<br>
</font></tt>
<br>
<br><tt><font size=2>OK, let me try to rephrase the question: in MOD(A,P)
the standard says: "</font></tt><font size=2 face="CMBX10">Result
Value. </font><font size=2 face="CMR10">The value of the result is A–INT
(A/P) * P.</font><tt><font size=2>"</font></tt>
<br>
<br><tt><font size=2>The question is: does this mean that any restrictions
apply to </font></tt><font size=2 face="CMR10">expression "A–INT
(A/P) * P"</font><tt><font size=2> also apply to intrinsic MOD()?</font></tt>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">Jim Xia<br>
<br>
RL Fortran Compiler Test<br>
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7<br>
Phone (905) 413-3444 Tie-line 313-3444<br>
email: jimxia@ca.ibm.com<br>
D2/YF7/8200 /MKM</font>
<br>