Skip to content

Conversation

@hnb22
Copy link
Contributor

@hnb22 hnb22 commented May 13, 2025

No description provided.

Copy link
Collaborator

@skirpichev skirpichev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forgot to add tests, probably to test_log().

mpmath/ctx_mp.py Outdated

def _nthroot(ctx, x, n):
if hasattr(x, '_mpf_'):
if ctx._is_float_type(x):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest put such refactoring changes separately.

Comment on lines 704 to 708
s = log_taylor(to_fixed(x, wp), wp) # returns fixed-point s
sb = s.bit_length() # bit count of fixed point
rman = s << (sb) # divide by 2^(-(bits))
rexp = -(sb+wp) # to get exponent, get negative of (bits + wp)
return from_man_exp(rman, rexp, prec, rnd) # input mantissa, exponent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you won't comment obvious steps. While stuff from the TODO could be rather helpful to describe what's going on in this block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants