Hello Vijayendra,
> I have a huge expression containing numbers, which I intend exporting
> to FORTRAN. Is there a way to change all the numbers in the
> expression to double precision fortran format eg. D0,D1 etc.?
>
> BFLOAT(expression) does this with a difference -- it adds B0, B1 ...
> Is it possible to change this behaviour?
At present it doesn't appear possible to get 1d0 for 1.0 or 1b0.
That's really too bad since all Maxima floats are
double precision, if not bigfloat.
Formatting numbers is eventually routed through EXPLODEN,
which, on inspection, doesn't seem to respect any flags
for numerical format.
Here's the part of EXPLODEN for formatting floats.
Maybe someone has some ideas here.
((floatp symb)
(let ((a (abs symb)))
(cond ((or (eql a 0.0)
(and (>= a .001)
(<= a 10000000.0)))
(setq string (format nil "~vf" (+ 1 $fpprec) symb)))
(t (setq string (format nil "~ve" (+ 4 $fpprec) symb)))))
(setq string (string-left-trim " " string)))
For what it's worth,
Robert Dodier
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com