Subject: eliminating '1.0' when divided by float numbers
From: ishi soichi
Date: Thu, 3 May 2012 10:32:11 +0900
Thanks for your answer.
it helps a lot!
soichi
2012/5/3 Stavros Macrakis <macrakis at alum.mit.edu>
> In Maxima, floating-point numbers represent approximate quantities. The
> formula 1.0*x is different from just x, which is an exact number. If you
> want to convert all approximate numbers to a nearby round number, you could
> do something like
>
> floats_to_rats(expr) :=
> block([ratprint:false],
> scanmap(lambda([q],if floatnump(q) then rat(q) else q),expr))$
>
> see ? ratepsilon to control the tolerance. You could also do rat(expr),
> but that will change the form of the expression in general.
>
> -s
>
> On Wed, May 2, 2012 at 9:19 PM, ishi soichi <soichi777 at gmail.com> wrote:
>
>> Maxima 5.25
>>
>> Hi. say I have an equation like
>>
>> 3 = 3.5 %e^( ...);
>>
>> then, I want to eliminate '3.5', so I divide the whole thing by 3.5.
>>
>> %/3.5;
>>
>> it gives,
>>
>> ... = 1.0 %e^(...)
>>
>>
>> '1.0' remains there. Of course there is no influence in terms of math,
>> but it matters if I want to take log of it,
>>
>> log(%);
>>
>> gives,
>>
>> ... = log(1.0 %e^(...))
>>
>> Is there anyway to eliminate '1.0' so that it becomes easier to compute
>> it?
>>
>>
>> soichi
>>
>>
>>
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>>
>