Hm, since we wanted to get away from implicit functions, the consistent
think to do would be to always require the base when a user wants to use
the log function. I think that this could avoid some confusion. In every
CAS, I have to check in the documentation what the program means by
log(x). In sage I had to read through the whole doc string and get to
the examples before I was able to deduce that log(x) is the natural log
of x:
Type: function
Base Class: <type 'function'>
String Form: <function log at 0xf5f4df0>
Namespace: Interactive
Definition: log(x, base=None)
Docstring:
Return the logarithm of x to the given base.
Calls the ``log`` method of the object x when computing
the logarithm, thus allowing use of logarithm on any object
containing a ``log`` method. In other words, log works
on more than just real numbers.
TODO: Add p-adic log example.
EXAMPLES::
sage: log(e^2)
2
sage: log(1024, 2); RDF(log(1024, 2))
10
I think that the doc string should say that log(x) = log(x,e) right at
the beginning.
Stan
William Stein wrote:
> On Sun, Aug 23, 2009 at 2:54 PM, William Stein<[email protected]> wrote:
>
>> On Sun, Aug 23, 2009 at 2:35 PM, Tim Lahey <[email protected]> wrote:
>>
>>> On Aug 23, 2009, at 5:25 PM, William Stein wrote:
>>>
>>>
>>>> So since Tim's from Waterloo that might explain his preference for ln.
>>>>
>>> I preferred ln(x) well before I learned Maple. Plus, all my textbooks
>>> used
>>> ln(x).
>>>
>
> OK, Wikipedia has a pretty useful discussion. It mentions 'As
> recently as 1984, Paul Halmos in his "automathography" I Want to Be a
> Mathematician heaped contempt on what he considered the childish "ln"
> notation, which he said no mathematician had ever used.' I read that
> book, so maybe that is one reason I don't like "ln". The Wikipedia
> page also says:
>
> "If, as in "log(x)", the base is not given explicitly, it may be
> understood implicitly by discipline:
>
> * Mathematicians understand "log(x)" to mean log_e(x). Calculus
> textbooks will occasionally write "log(x)" to represent "log_10(x)".
>
> * Many engineers, biologists, astronomers, and some others write
> only "ln(x)" or "log_e(x)" when they mean the natural logarithm of x,
> and take "log(x)" to mean log_10(x) or, in computer science, log2(x).
>
> * In most commonly used computer programming languages, including C,
> C++, Java, Haskell, Fortran, Python, Ruby, and BASIC, the "log"
> function returns the natural logarithm. The base-10 function, if it is
> available, is generally "log10."
>
> This chaos, historically, originates from the fact that the natural
> logarithm has nice mathematical properties (such as its derivative
> being 1/x, and having a simple definition), while the base 10
> logarithms, or decimal logarithms, were more convenient for speeding
> calculations (back when they were used for that purpose)."
>
>
>
>
> ---
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---