and it compiles and works beautifully. The trouble is I now have to call it from a fortran program. I tried interoperability algorithms and they do not work. So I decided to convert the code to gfortran. There are some statements there I cannot understand however, e.g.
So, I am getting compile errors, besides I don't understand where the condition is inside the while statement. There is no relational operators, just bits shuffling.
The second problem is this:
constdouble pi = Inverse ? 3.14159265358979323846 : -3.14159265358979323846;
I converted it to fortran this way:
1 2 3 4 5 6 7
Logical :: inverse
If (inverse) then
pi = 3.14159265358979323846
else
pi = -3.14159265358979323846
endif
I don't know. It does not make sense to me. Besides you did not explain anything. I do not understand where the condition is in the original while statement unless the false is represented by numerical 0 in C. How does the break statement appear?
I would really appreciate if somebody else would comment.
in original code, it will first make mask>>=1 , then, mask and target will have an 'and' operator and if result is not equal to zero, it will continue, else, it will be break out of while statement.
and about second question, it seems true.