主题:谁能帮我看看这段C语言代码,怎么翻译成fortran
for (i = 0; i < n; i++) {
j = 0;
k = n_bits;
while (k) {
if (k >= 8 && bit_mask == 128) {
j = 256 * j + *bits;
bits++;
k -= 8; /*k=k-8*/
}
else {
j = j + j + ((*bits & bit_mask) != 0);
if ((bit_mask >>= 1) == 0) { /* bit_mask = bit_mask >> 1; 右移位*/
bits++;
bit_mask = 128;
}
k--;
}
}
*flt++ = ref + scale*j;
}
j = 0;
k = n_bits;
while (k) {
if (k >= 8 && bit_mask == 128) {
j = 256 * j + *bits;
bits++;
k -= 8; /*k=k-8*/
}
else {
j = j + j + ((*bits & bit_mask) != 0);
if ((bit_mask >>= 1) == 0) { /* bit_mask = bit_mask >> 1; 右移位*/
bits++;
bit_mask = 128;
}
k--;
}
}
*flt++ = ref + scale*j;
}