Some common lisps might have only one precision. Some may
have as many as 4, I think. I would guess it would take
almost no code change to make floats have a d0. Like 2
characters in a format statement (yes, lisp has formatted
output..)
If you really want single precision, can't you always do this..
single precision s,t,u,v
s= 3.1234567890123456d0
C s is single precision even though the constant is double.
C you could also set up an array of single s(1), s(2) ...
C for your purposes. You don't know offhand how many
C digits for single, unless you are sure the user is
C not on an old CDC machine :)
RJF
J. Milgram wrote:
>> Judah> 1. On Fortran output, is there a way to cause floats to come out with a
>> Judah> "d0" at the end? Some compilers really do want this.
>>
>>What happens, then, if you really wanted single-precision floats?
>
>
>>What happens, then, if you really wanted single-precision floats? I
>>think maxima has historically always done everything in
>>double-precision, so all number are doubles.
>
>
> Hi,
>
> [did you mean "all numbers are singles"?]
> If you really want single-precision, but append "d0", there's no problem
> from an execution point of view, although I suppose in some cases it
> could cost you performance. Just speculating.
>
> The other way around however will produce unexpected results with some
> compilers. Example, with g77 (gcc 3.2) on a PIII:
>
> program buggy
> double precision pi,pibug
> pi=3.14159265358979d0
> pibug=3.14159265358979
> write (6,*) pi,pibug
> end
>
> Prints two versions of pi, differing in the 8th significant digit:
>
> f77 buggy.f
> ./a.out
> 3.14159265 3.14159274
>
> Some compilers don't do this, some do, either way it's legal Fortran 77,
> so you have to plan for the worst.
>
> Maybe the "d0" could be an switchable option.
> For now I'm just postprocessing the output with a simple Python script;
> eventually I'll build up the courage to try it in Lisp.
>
> Judah
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima