floating point numbers format



  sabato 13 giugno 2009, 07:37, Richard Fateman:

> Giovanni wrote:
>
> > - 1/333 is printed as 0.00 I'd like to have printed as 0.3*10^-2
> > (more generally, it should print 0 only if it's really 0)
> 
> I fixed this so it doesn't print 0.00   But it prints as - 1.00/333.00

  I've tried again your hackform.lisp. 1/333 still print out as 0.00

> > - trying to plot a function like f(x):=a*x - b* x^2/2 i've got the
> > following message (and no plot):
> >
> > Maxima encountered a Lisp error:
> >   
> Probably fixed.  Of course this works only if there are numeric
> values for a, b.

  Yes, a and b are numeric coefficients. Now it works like a charm!

  Speaking more generally, what i'd like to have, it's to plot some (or
even all) results in a compact form. In example:

100 -> 100 with no change
1/3,numer -> 0.33
1/3000,numer -> 3.33*10^-4

  Probably a variable as "max_decimals_to_display" it will be best
suited for what i'm looking for.

  Regarding your recommendation of doing a "fair" use of
format_for_numbers, you are suggesting something like this?

format_for_numers: "~,2F"
first_result,numer
second_result,numer
format_for_number:false

Thanks again for your handful hackform!

Giovanni