Python Forum
natural logarithm print
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
natural logarithm print
#2
math.log(x[,base]) is how it is written in the help docs to indicate that base is an optional argument.  The default is e, so math.log(x) returns ln(x).

From your description however it sounds like you are expected to return e**x, not ln(x).
>>> import math
>>> math.exp(5)
148.4131591025766
>>> e = math.e
>>> e**5
148.41315910257657
>>>
Reply


Messages In This Thread
natural logarithm print - by atux_null - Oct-20-2017, 09:07 AM
RE: natural logarithm print - by Mekire - Oct-20-2017, 10:29 AM
RE: natural logarithm print - by atux_null - Oct-20-2017, 12:58 PM
RE: natural logarithm print - by sparkz_alot - Oct-20-2017, 01:52 PM
RE: natural logarithm print - by atux_null - Oct-20-2017, 02:01 PM
RE: natural logarithm print - by sparkz_alot - Oct-20-2017, 02:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Natural language processing project maaaa2401 1 1,841 Dec-04-2020, 07:26 PM
Last Post: Larz60+
  a generator that computes squares of first 20 natural numbers mdshamim06 1 8,968 Oct-01-2019, 10:38 AM
Last Post: buran
  need help in natural language processing irsyadfm 7 4,546 Aug-07-2019, 07:42 AM
Last Post: tkorol
  Natural Logarithm in Python yg89 8 26,837 May-07-2017, 12:36 AM
Last Post: yg89

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020