Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29390 Discussions

Floating point issues - Calling fortran from C

vikrantca
Beginner
543 Views
Hello,
I am trying to call a fortran dll (VS 2005, IVF 10) from a C++ program (VS 2005, Console app.)
The fortran subroutine involves several iterations. When called from the C++ application, the iterations do not converge due to floating point number differences, but when the fortran dll is called from a fortran code, (hardcoding the inputs), the subroutine works fine.
Is there a compiler switch/setting that I should tweak ?

Thank you
-VA
0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
543 Views

Fortran calls by reference, C++ calls by value. Make sure the C++ call to the Fortran DLL is passing "&YourREALvariable" (by reference)and not "YourREALvariable" (by value).

Jim Dempsey

0 Kudos
Reply