Maple User Group List Archive
Archive by date
This Month By Date
This Month By Topic
[MUG] Re: log( ) and prettyprinting
|[MUG] Re: log( ) and prettyprinting
Author: Robert Israel
Posted: 20/10/2000 00:42:44 GDT
|>> From: Robert Israel
It has nothing to do with printing, pretty or otherwise. The answer is
simply that unless x is a float, log(x) returns a symbolic answer
ln(x)/ln(10). There is no simplification (apart from whatever ln does to
1000.0 is a float, so log(1000.0) returns 3.000000000.
1000 is an integer, not a float, so log(1000) returns
ln(1000)/ln(10) (and "ln" doesn't do any simplification on ln(1000)).
However, simplify(log(1000)) will return 3, and evalf(log(1000))
will return 3.000000000.
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
On Thu, 12 Oct 2000, Nathan Sokalski wrote:
> >> From: "Nathan Sokalski"
> In general, undetailed, non-technical terms, would it be correct to say that
> prettyprinting displays the function rather than the "answer" when an exact
> decimal or fraction does not exist? Anyway, isn't it supposed to give the
> numerical answer if it is just a simple 3 or 4 kind of answer? Well, why
> doesn't it do that when I enter log(1000); or log(10000); ? The
> answer is an exact integer, right? Yes, I do know how to use evalf() and
> change the settings for prettyprinting, but why should I need to do this for
> such a simple answer? I did notice that when it displays the answer it
> displays ln(1000)/ln(10) , which uses the natural log. Is there some
> internal rounding that occurs with the natural log in the process that makes
> it think 3 or 4 is not the exact answer? Any info would be appreciated.
> Nathan Sokalski
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> Share information about yourself, create your own public profile at
[View Complete Thread]
Previous by date: [MUG] Illustrating Trapezoidal Rule, Gold1
Next by date: [MUG] slow series(solve(..)) quirk in Maple VI, V.X>3, Desmond Johnston
Previous thread: [MUG] Step-by-step solving and verifying of differential equations, Chuck Baker
Next thread: [MUG] solve, Ruth Plathe