MathGroup Archive 1992

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

Search the Archive

Displaying real numbers


[Mathematica 2.0 for Sun SPARC]

Is there a way to make Mathematica print numbers in a FORTRAN-like
way, e.g.

  -2.45658E-3

rather than

             -3
  -2.45658 10

I am using Mathlink to call Mathematica from a Common Lisp program
(via an intermediate C function).  Since calling C from Lisp is
expensive, I have Mathlink return its results as a FullForm string
which I parse in Lisp into a Lisp S-expression.  Doing it this way
avoids the many calls to the Mathlink parsing functions I would
otherwise have to make (each via a C function) were I getting the
results back from Mathematica in the usual manner.

Since they are both prefix notations, parsing a FullForm string into a
Lisp S-expression is easy, *except* for Mathematica's insistence on
writing numbers in scientific notation with the exponent on the line
above.  A FORTRAN-like notation would be much easier to parse.

thanks,

Franz Amador
franz at cs.washington.edu
{rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!franz





  • Prev by Date: ReplaceAll feature
  • Next by Date: Re: Which computer to buy (NeXT, Mac, PC)...
  • Previous by thread: Re: ReplaceAll feature
  • Next by thread: "FORTRAN" format followup