Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Input and Output / Format Types  /
FortranForm

  • FortranForm[ expr ] prints as a Fortran language version of expr.
  • Standard arithmetic functions and certain control structures are translated.
  • FortranForm acts as a "wrapper", which affects printing, but not evaluation.
  • The width of output lines must be set explicitly by giving the option PageWidth -> n for the relevant output stream.
  • SetOptions[$Output, PageWidth -> 72] uses a line width of 72 characters for standard Mathematica output.
  • No declarations are generated.
  • See the Mathematica book: Section 1.11.4Section 2.8.1.
  • See also: CForm, Compile.

    Further Examples

    The FortranForm is equivalent to the original quadratic.

    In[1]:=

    Out[1]//FortranForm=

    In[2]:=

    Out[2]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.