On Tuesday, November 5, 2013 5:53:35 AM UTC-5, Pedro Cruz wrote:
>
> The problem is to have a real logarithm function of a certain base that 
> doesn't transform "it self" into log(x)/log(base).
>
> We try to study the implementation of the Sage "log" functions [1] and the 
> "coercion" model [2] but all of this seems to complex for this simple 
> problem.
>
> The solution we got is below and uses:
>
>  1. A sage "formal function":
> LOG_ = function('logb', x, b, print_latex_func=_LOG_latex) 2. A latex way 
> to express this function: def _LOG_latex(fun,x,base=None): 3. An 
> algorithm implemented as a python "def" function. def logb(x,base=e,
> factorize=False) that returns the "formal function" as an answer. Is this 
> the proper way to do it in Sage ?
> Could it be better and simple?
>
>

This looks pretty useful!  I wonder whether it could find a home in Sage, 
though one would have to make sure that it didn't conflict with something 
else.

The "best" way to do this is to use BuiltinFunction like at 
sage/functions/hyperbolic.py or the like... obviously for your own purposes 
this is just fine.  But that one has a nice way to put in typesetting etc.

Good luck!
- kcrisman 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to