Giovanni wrote:
> gioved? 11 giugno 2009, 13:53, Richard Fateman:
>
>
>> load into your maxima:
>>
>> http://www.cs.berkeley.edu/~fateman/lisp/hackform.lisp
>>
>> [...]
>>
>> format_for_numbers: "~R"
>>
>> which will make 23 print like twenty-three
>>
>
>
> Thanks for replaying. Your suggestion it's quite useful, but i've
> found some problems. I've tried with
>
> format_for_numbers: "~,2F"
>
> and:
>
> - 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
> - every number follows the above defined rule. I mean, x^2 it's printed
> as x^2.00 or 1/2 as 1.00/2.00
>
Yes. That is what you said you wanted. But see below.
If you want fractions like 1/2 or 1/333 to be converted to
floating-point numbers, that is not a display problem. That is a
transformation that you decide to do on the numbers themselves, and the
values are different. As you know, 1/3 cannot be represented as an exact
float. Even 1/10 cannot be represented as a binary float exactly.
> - 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.
Perhaps what you would like is for integers and exact rational numbers
and bigfloats to be printed in the usual way,
and only convert "machine floating-point" numbers using format_for_numbers.
Considering the new specifications, I've change hackform. Try it again.
Note once again that keeping format_for_numbers as something other that
false is NOT recommended generally.
There may be programs that compute with some properties of the
"formatted" version of maxima expressions,
and would object to strings like "1.23" in places that numbers are
expected.
For the system programmers reading this, I expect that "minus" is
defined as a macro in maxima, and it
is lost at runtime. So I changed (minus x) to (- x), etc.
Anyway, try hackform.lisp again.. :)
>
> EVAL: undefined function MINUS
> Automatically continuing.
> To reenable the Lisp debugger set *debugger-hook* to nil.
>
> I'm using
> Maxima version: 5.16.3
> Maxima build date: 12:31 11/5/2008
> host type: i386-redhat-linux-gnu
> lisp-implementation-type: CLISP
> lisp-implementation-version: 2.46 (2008-07-02) (built on
> xenbuilder4.fedora.phx.redhat.com)
>
> thanks,
> Giovanni
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>