KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
It is my understanding that you can return an array from a function in Fortran, but for some reason my code is only returning the first value in the array I am asking it to return. This is the function: function polynomialMult(npts,x,y) integer npts double precision x(npts), results(npts + 1), y(npts,npts) polynomialMult = x(1:npts) + 1 end function and this is where I'm calling it C(1:numPoints) = polynomialMult(numPoints,x,f) print *, C(1:numPoints)` right now it doesn't do anything useful because I am trying to understand the syntax before I write the logic. I saw some stuff about specifying types for functions, but when I write integer function polynomialMult(npts,x,y) or whatever I get a compilation error.
Tags (comma-separated)
Save Edits
Cancel