Input a polynomial into FORTRAN?

Click For Summary
SUMMARY

The discussion centers on inputting a polynomial into FORTRAN via the command prompt. A user suggests creating a custom subroutine that accepts an integer for the polynomial degree and a vector for the coefficients. An alternative method involves reading polynomial data from a text file to streamline input and reduce errors. Additionally, a Google search for "fortran read command line" is recommended for further resources.

PREREQUISITES
  • Familiarity with FORTRAN programming language
  • Understanding of polynomial mathematics
  • Knowledge of subroutine creation in FORTRAN
  • Experience with file I/O operations in programming
NEXT STEPS
  • Research how to create custom subroutines in FORTRAN
  • Learn about vector data structures in FORTRAN
  • Explore file I/O operations in FORTRAN for reading text files
  • Investigate command line input handling in FORTRAN
USEFUL FOR

This discussion is beneficial for FORTRAN programmers, mathematics enthusiasts, and developers looking to enhance their input methods for polynomial computations.

danerape
Messages
31
Reaction score
0
Input a polynomial into FORTRAN?

Hello all, I took a Fortran programming class last semester and can write Fortran well. However, I never recall anyone ever asking if there would be a way to input a polynomial into the command prompt. I'm assuming there is not. It would be great though. I have written an entire diff and int program that can do logs,trig,exp,inverse, basically everything. I still have to chose what kind of diff/int, the degree and input each coefficient on its own. Would be nice to just enter a poly and hit enter.

THANKS
 
Technology news on Phys.org


You could write your own subroutine to do it. You could use a function with two arguments, an integer (polynomial degree) and a vector of the coefficients.
 


It is not the solution you requested, but couldn't you just have the program open and read from a text file? It would save you the trouble of constantly entering the data one-at-a-time, possibly making typos, etc. That is what I do, especially during the debugging phase of writing a program.

Alternately, I did a Google search for

fortran read command line

and came up with many results. Perhaps there is something there that can help you.
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 59 ·
2
Replies
59
Views
12K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K