Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Issues with EXP function gcc FORTRAN

Issues with EXP function gcc FORTRAN

Issues with EXP function gcc FORTRAN

Hello fellow FORTRAN users,

I am having issues with EXP function with gcc FORTRAN compiler (version 4.7). This error manifests only when I create a dll out of the code. When I create an executable there is no issue.

Below is a sample code I have. In this if the argument to EXP function is declared REAL (single precision), then the EXP returns a correct value. However when I change it to Double Precision, then all "hell breaks loose". The EXP function returns garbage.

I read that there is some problem with run time libraries in gcc FORTRAN which is causing issues with EXP function. Is there any way to overcome this issue? Did the new compiler version (4.9, I think) that recently came out fix the issue?

CODE --> English

SUBROUTINE TryDll(Var1,Var2,Var3,Var4)

  REAL, INTENT(IN) :: Var1
  REAL, INTENT(IN) :: Var2
  REAL             :: ReturnResult
  Var3 = Add(Var1,Var2)
  ReturnResult = Subtract(Var1,Var2)
  Var4 = EXP(ReturnResult)


Any help is greatly appreciated.


RE: Issues with EXP function gcc FORTRAN

hhhmmm...have you given DEXP a try? Again, though, if your current compiler is having an issue with polymorphism, you should be consistent in both types your variables and expected arguments in functions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close