Fortran FORTRAN 95: New to fortran, want to learn how to input a function

AI Thread Summary
Learning FORTRAN and developing a trapezoidal integration program involves challenges, particularly in allowing user input for mathematical functions. A key point in the discussion is the need for a method to parse arithmetic expressions, which is more complex in compiled languages like FORTRAN compared to interpreted languages like Perl. Users are advised to search for existing code or libraries that can assist with parsing arithmetic expressions in FORTRAN. Suggested search terms include "parsing arithmetic expressions fortran" and "arithmetic parser fortran" to find relevant resources.
FuriousJ
Messages
5
Reaction score
0
Hey guys, this is my first post here.

So I'm learning FORTRAN, and I'm writing a trapezoidal integration program as a learning exercise. What I want to do is in addition to asking the user to input the range and precision of the calculations they'd like, I'd also like to be able to enter in the function itself.

From what I can gather this is a fairly non-trivial process and I could use some help.

Even just a general mode of attack that can set me on the right path would be helpful.

Thanks in advance.
 
Technology news on Phys.org
You need to write some code for parsing arithmetic expressions, or find some code that someone else has written. Try Googling for something like

parsing arithmetic expressions fortran
arithmetic parser fortran

etc.

With an interpreted language like Perl, it's often possible to read an arithmetic expression as a string and simply evaluate it. With compiled languages like Fortran, you generally can't do this.
 
Last edited:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top