Ticket #12113 (closed enhancement: fixed)

Opened 18 months ago

Last modified 5 months ago

Add minor clarification about logs with bases other than e

Reported by: kcrisman Owned by: mvngu
Priority: minor Milestone: sage-5.6
Component: documentation Keywords: beginner
Cc: jason Work issues:
Report Upstream: N/A Reviewers: Travis Scrimshaw
Authors: Yoora Yi Tenen Merged in: sage-5.6.beta0
Dependencies: Stopgaps:

Description (last modified by tscrim) (diff)

See  this ask.sagemath.org question. Essentially, the poster requests (and it seems reasonable) to add a couple more examples of this. E.g.,

If you could make this change it would be great: "EXAMPLES:
sage: log(e^2)" :
To something like: 
EXAMPLES: 
To change the base of the logarithm, add a second parameter. 
sage: log(1000,10) 
3
Small change but helpful!

This is implicit in the examples, but since the first line is just

Return the logarithm of x to the given base.

and not everyone will understand

File:           /Users/.../sage-4.7.2/local/lib/python2.6/site-packages/sage/functions/log.py
Definition:     log(x, base=None)
Docstring:
       Return the logarithm of x to the given base.

Sounds like a good beginner ticket.


Apply: trac_12113_clarification_about_logs.patch

Attachments

trac_12113_clarification_about_logs.patch Download (1.4 KB) - added by yooyiten 6 months ago.
Added documentation for log()

Change History

comment:1 Changed 18 months ago by kcrisman

  • Description modified (diff)

comment:2 Changed 18 months ago by jason

  • Cc jason added

comment:3 Changed 14 months ago by ppurka

Some comments:

  1. When you add a patch and you are confident that it is correct, set the flag "Needs review" under "Modify Ticket".
  2. Your patch touches a lot of files! From a two-line patch, it has bloated into a 285kB file. The reason is that when you installed sage (I suspect you installed sage in a fat/ntfs partition), all the files got changed to executable files. This needs fixing.

comment:4 Changed 6 months ago by yooyiten

  • Status changed from new to needs_review

comment:5 Changed 6 months ago by ppurka

Hello, Can you fix your name in the hg header, at the top of the patch? The names don't match. If you used someone else's hgrc file, then you need to set your own email and name in the hgrc file.

comment:6 Changed 6 months ago by tscrim

  • Status changed from needs_review to needs_work
  • Reviewers set to Travis Scrimshaw

A few things I would like to see:

  • Instead of log() I would prefer to see linking via :meth:`log()`
  • The line Use with the RDF function..., I would change it to
    You can use the :class:`RDF<sage.rings.real_double.RealDoubleField_class>`,
    :class:`~sage.rings.real_mpfr.RealField` or ``n`` to get a numerical real approximation::
    
    since RDF is the real double field and it is constructing an element of that class.
  • Remove the line about the n function
  • Add your real name as the author on the trac ticket

You can check to make sure the documentation looks correct too by calling sage -docbuild reference html and looking in the doc/output/html/ folder in your web browser.

Thanks,
Travis

Changed 6 months ago by yooyiten

Added documentation for log()

comment:7 Changed 6 months ago by yooyiten

  • Status changed from needs_work to needs_review
  • Authors set to Yoora Yi Tenen

Thank you for your recommendations. I 've made the suggested changes.

comment:8 Changed 6 months ago by tscrim

  • Status changed from needs_review to positive_review

Looks good to me. Thanks.

comment:9 Changed 6 months ago by tscrim

  • Description modified (diff)

For patchbot:

Apply only: trac_12113_clarification_about_logs.patch

comment:10 Changed 5 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.6.beta0
Note: See TracTickets for help on using tickets.