Re: Unexpected results
- To: mathgroup at smc.vnet.net
- Subject: [mg14274] Re: Unexpected results
- From: tdelling at ews.uiuc.edu (Tim Dellinger)
- Date: Mon, 12 Oct 1998 13:51:53 -0400
- Organization: University of Illinois at Urbana-Champaign
- References: <6vf4vc$dg9@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Daniel Zepeda <dzepeda at ringer.cs.utsa.edu> writes: >Plot[10^Log[x], {x, 0,10}] >plot what I expect? I expect it to plot y=x, but it doesn't, it plots an >what looks like an exponential curve. This is the stupidest thing that Mathematica does. It's really downright user-unfriendly. Log[x] gives you the natural log of x. Not what you'd expect, eh? One of the great things about Mathematica is that you can play with it to see what's going on. Try Log[100.] or N[ Log[100] ]. You'd expect to get the answer 2. But you don't get it! So therein lies your problem. Another great thing about Mathematica is online documentation. Try ? Log and see what you get. It will explain that Log[x] really means the natural log of x, and if you want the base 10 log, try Log[10,x]. I think that base 10 should be the default instead of base e, as it is conventional to use log[x] and ln[x] as notation. If you want to change the base to e, you should either have to do that manually, or have a separate function Ln[x]. The main reason I think so is that it helps people who are new to Mathematica, and it would increase readability. Or perhaps Log[] should require two arguments, with no defaults. That's one of my major peeves with Mathematica. -- __ Tim Dellinger www.ews.uiuc.edu/~tdelling tdelling at uiuc.edu