!
&&
||
==
!=
>
>=
<
<=
real a(0:NN)
..
x = a(3)
...
↓
double a[NN+1];
..
x = a[3];
real a(N)
...
do i=1,N
a(i)=0.0
end do
...
x=a(3)
↓
double a[N];
...
for (i=0; i<N; i++)
a[i] = 0.0;
...
x = a[2];
または
double a[N+1];
...
for (i=1; i<=5; i++)
a[i] = 0.0;
...
x = a[3];
real mat(3,3)
x = mat(i,j)
↓
double mat[3][3];
x = mat[i][j];
real a(NDIM,NDIM)
...
a(i,j)=むにゃ
...
call inv(NDIM,3,a)
..
subroutine inv(NDIM, N, a)
integer NDIM,N
real a(NDIM,*)
...
↓
double a[NBIG][NBIG];
...
a[i][j] = むにゃ
...
inv(3,a);
...
void inv(int n, double a[][NBIG])
double *a;
...
a = malloc(sizeof(double) * n * n); if (a == NULL) ...
...
a[i*3+j] = むにゃ
...
inv(3,a);
...
void inv(int n, double *a)
double *a[NDIM];
for (i = 0; i < 3; i++) {
if ((a[i] = malloc(sizeof(double) * 3)) == NULL) {
}
}
...
a[i][j] = むにゃ
...
inv(3,a);
...
void inv(int n, double **a)
real a(0:NN,M)
...
x = a(0,j)
↓
double a[NN+1][M];
...
x = a[0][j];
stop
↓
exit(0); 正常終了の場合
あるいは
exit(1); 異常終了の場合
L=j**2
n=j**3
m=j**4
x=y**0.5
z=y**(1.0/3.0)
↓
L=j*j;
n=j*j*j;
tmp = j*j; m=tmp*tmp;
x=sqrt(x);
z=pow(x,1.0/3.0)
%e, %f, %g に。 I 変換は printf() の書式文
字列内では %d に。
integer n;
real x,r
...
x=float(n)
r=float(1)/float(n)
call mysub(a, float(n))
↓
int n;
double x,r
...
x=n; 自動的に型変換される。
r=1.0/n; 1.0 に合わせて n は double に型変換される
mysub(a, (double)n); もしも mysub() にプロトタイプ宣言があれば
キャストは不要である。