FortranForm of Integers and Reals
- To: mathgroup at smc.vnet.net
- Subject: [mg60996] FortranForm of Integers and Reals
- From: Robert Schoefbeck <schoefbeck at hep.itp.tuwien.ac.at>
- Date: Fri, 7 Oct 2005 03:37:41 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I have a stupid problem when I try to export Fortran Code from
Mathematica into some .F file.
For example, I want to achieve that
Format[3. xy, FormatType->FortranForm]
That is, I want to have Integers as xdn and reals as ydn where n is the
exponent of 10. First I tried
which gets me
which is JUST what I want, except that it doesnt work with ToString:
The reason is that toString does not get the actual function FortranForm
but only the Identifier "FortranForm" and then proceeds as usual, i.e.
not as I want it to.
I have not succeded in redefining Format[int_, FortranForm] without
generating infinite recursions.
I do think that there should be an easy way out.
I'd very much appreciate any help.
Prev by Date:
Re: Problem with D and Abs
Next by Date:
Re: Assigning (really dumb question)
Previous by thread:
Re: Globally limiting precision or accuracy
Next by thread:
Re: FortranForm of Integers and Reals