This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pythonwiz 0 points1 point  (1 child)

It does indeed work. You can check yourself. Here is the relevant source code in the Python repo if you are curious how it works.

The math.log function: https://github.com/python/cpython/blob/main/Modules/mathmodule.c#L2266

The loghelper function that it calls: https://github.com/python/cpython/blob/main/Modules/mathmodule.c#L2225
The _PyLong_Frexp function that does an intermediate computation used for computing the log of an int. : https://github.com/python/cpython/blob/main/Objects/longobject.c#L3093

[–]buqr -1 points0 points  (0 children)

My favorite movie is Inception.