Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FortranForm

  • To: mathgroup at
  • Subject: [mg109552] Re: FortranForm
  • From: "slawek" <slawek at>
  • Date: Wed, 5 May 2010 06:04:45 -0400 (EDT)
  • References: <hrosvr$5sc$>

U=BFytkownik "Gideon" <gideon.simpson at> napisa=B3 w wiadomo=B6cigrup
dyskusyjnych:hrosvr$5sc$1 at
> I have two, possibly related, questions on the FortranForm command.
> 1.  Is it possible to get Fortran 90/95 style output?  In particular,
> I'd like to have long lines broken up with the end of line &
> character, rather than the sixth column indicator as it is now.

The output in the "fortran form" is not a "clean" Fortran IV/77/90/95/2003
source.  :(

A simple gawk script should help.

BTW, CForm does not give "clean" C source.

> 2.  Is it possible to get it to output decimals where it has whole
> numbers?  For instance, in some code I have, a factor of sqrt(2)

Use N, here is a example (20-digit acc.):

N[yourExpressionHere,20] // FortranForm
N[Sqrt[2]] // FortranForm


  • Prev by Date: DistributeDefinitions statement appears to create memory leak
  • Next by Date: mathlink error handling inside :Begin: - :End:
  • Previous by thread: FortranForm
  • Next by thread: Re: FortranForm