Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

How to define complicated function

Anonymous47
Beginner
554 Views
I have one function to define like that
f(x)=a(x)*b(x)*c(x)*d(x)
which a,b,c,d are independent ones.
For C language
to load the function within another function
it's better to include the definition within the form
just like
long f(x)
integer x;
long a(int);
long b(int);
long c(int);
longt d(int);
.....
i am not quite clear how it can be finished in Fortran.
Would any one tell me in detail?
0 Kudos
2 Replies
jim_dempsey
Beginner
554 Views

There are several ways to declare this. The following is but one

Code:

function f(x)
    ! function return type declaration
    integer f:
    ! calling arg declartion
    integer :: x
    ! external function type declarations
    integer :: a,b,c,d
    ! code
    f=a(x)*b(x)*c(x)*d(x)
end function f


0 Kudos
Anonymous47
Beginner
554 Views
Thanks for your quick reply
But i still have some questions.
Can we discuss through email!
my present one :ywangwnlo@163.com
0 Kudos
Reply