Python Forum
ln2 value is _math.c (cpython)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ln2 value is _math.c (cpython)
#7
You can get more decimals with the decimal module
>>> Decimal.from_float(log(2))
Decimal('0.69314718055994528622676398299518041312694549560546875')
which shows that the hard-coded value was indeed the decimal value of the ieee-754 number rounded to a higher order. I agree that it is strange.
Reply


Messages In This Thread
ln2 value is _math.c (cpython) - by matanya_stroh - Feb-06-2018, 02:44 PM
RE: ln2 value is _math.c (cpython) - by Larz60+ - Feb-06-2018, 07:44 PM
RE: ln2 value is _math.c (cpython) - by Larz60+ - Feb-06-2018, 08:01 PM
RE: ln2 value is _math.c (cpython) - by Gribouillis - Feb-06-2018, 08:14 PM
RE: ln2 value is _math.c (cpython) - by buran - Feb-06-2018, 08:19 PM
RE: ln2 value is _math.c (cpython) - by Gribouillis - Feb-06-2018, 08:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [CPython] Can't run script python VietVH 2 1,210 May-21-2022, 04:49 PM
Last Post: VietVH
  ImportError: /home/ali/Documents/test/charm/core/crypto/AES.cpython-39-x86_64-linux-g Anldra12 0 1,239 Apr-28-2022, 07:13 AM
Last Post: Anldra12
  Reducing runtime memory usage in Cpython interpreter david_the_graower 2 2,226 Oct-18-2021, 09:56 PM
Last Post: david_the_graower
  Navigating cpython source using python quazirfan 3 2,037 Aug-09-2021, 07:52 PM
Last Post: quazirfan
  IronPython from CPython amasis 3 2,217 Feb-05-2021, 12:26 PM
Last Post: jefsummers
  ImportError: /home/pybind11_example.cpython-37m-x86_64-linux-gnu.so: undefined symbol chaitra 2 5,125 Feb-03-2021, 05:14 AM
Last Post: chaitra
  compiled cpython output wrong version bigrockcrasher 0 1,515 Feb-25-2020, 06:31 PM
Last Post: bigrockcrasher
  CPython: Knowing when the interpreter expects more input b0bh00d 1 2,097 Apr-18-2019, 05:08 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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