I have another small question. In that Matlab code there are things like
s^m
where both s and m are integers. For example s=6, m=63, so s^m=6^63=10^49 or so.
Thing is Matlab have no problem calculating 6^63,
Now, in Fortran, here both s and m are not big intergers, they are at most 60, so I may casually define them as integer(4). However in this example, the result s^m=6^63 cannot be represented by integer(4), integer(8) perhaps even higher should be used. So if I define s and m as integer(4) I got wrong results for s^m.
How would you handle case like that?
I mean, do you manually change
s**m
to
int(s,kind=8)**m
or
real(s,kind=8)**m
if you suspect that s**m may overflow?
Many thanks!
PS.
This is perhaps somehow similar with some other posts before