Convert Fortran program to Java
-
Hi, I have a Fortran program which I have to convert into Java originally. I have converted the code completely but can't get appropriate resutls. The code contains lot of arithmetic calculations using double precision data type of Fortran. I believe the data types of Java are based differnt than Fortran. Fortran's double precision type is based on IEEE756. I want to know how to convert these double precision calculations into Java. For example:
double precision d1 = 0.3648564D0;
d1**2 // ** indicates exponent
DSIN(d1) // sin of double precision
DCOS(d1) // cos of double precisionThe above are my main concerns which I find very difficult to convert. I use Math.sin & cos for DSIN & DCOS. But Fortran 77 deals somthing differntly with double precision. How to convert/translate that into our java application is what I am looking for. If you can provide the same for C++ that would also be a plus for me, I will use the code accordingly of Java application. Please help me out. Am stuck up very badly.
Thanks Terry
-
Hi, I have a Fortran program which I have to convert into Java originally. I have converted the code completely but can't get appropriate resutls. The code contains lot of arithmetic calculations using double precision data type of Fortran. I believe the data types of Java are based differnt than Fortran. Fortran's double precision type is based on IEEE756. I want to know how to convert these double precision calculations into Java. For example:
double precision d1 = 0.3648564D0;
d1**2 // ** indicates exponent
DSIN(d1) // sin of double precision
DCOS(d1) // cos of double precisionThe above are my main concerns which I find very difficult to convert. I use Math.sin & cos for DSIN & DCOS. But Fortran 77 deals somthing differntly with double precision. How to convert/translate that into our java application is what I am looking for. If you can provide the same for C++ that would also be a plus for me, I will use the code accordingly of Java application. Please help me out. Am stuck up very badly.
Thanks Terry
do you know something called "javadoc" ? ;P just kidding in java (and in C++), the type
double
handles such precision. then, you just have to call the correct functions, which you'll find reference in the online documentation. in C++, just#include <cmath>
and use sin() and cos() like this. in Java, just call Math.sin() and Math.cos()...[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]