A log(101,base=10) that doesn't reply log(101)/log(10)

28 views
Skip to first unread message

Pedro Cruz

unread,
Oct 28, 2013, 6:28:04 AM10/28/13
to sage-s...@googlegroups.com

Dear Sage supporters,


i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

How can I develop the function below ? Where should I start to read?

"""
HSLOG = "
High School Log".

Treat forms like `\log_b(a^p)` in a special manner.

Standard sage log with integer arguments works like this:

::    
    sage: log(101^3,10)
    log(1030301)/log(10)
    sage: 3*log(101,10)
    3*log(101,10)
    sage: 10^log(101,base=10)  #101
    10^(log(101)/log(10))

and    

::    
    sage: log(101,10)
    log(101)/log(10)
    sage: latex( log(101,10) )
    \frac{\log\left(101\right)}{\log\left(10\right)}  %ie: log(101)/log(10)

What we want is:

    sage: HSLOG(101,10,3)   #log_{10}(101^3)
    3*log(101,10)
    sage: HSLOG(101,10) #log_{10}(101)
    log(101,10)
    sage: 10^HSLOG(101,10) #10^log_{10}(101^3) = 101
    101
    sage: latex( HSLOG(101,10) )
    \log_{10}(101)
"""
Reply all
Reply to author
Forward
0 new messages