[Tfug] OT: Python: Fractional Exponents of Negative Numbers

Charles R. Kiss charles at kissbrothers.com
Sun Jan 17 20:24:03 MST 2010


At the risk of being flamed; I posted this on a python forum and thought I would solicit comments from TFUG since I know there are some great programmers here.

Because I get a ValueError:

"Is there a module out there that can approximate a real solution to a function containing a negative number raised to a fractional exponent? For example, solving for m in: C=m**m*((A**(m+1))/B**m), where A and B are known, and of opposite sign, and C is known.

My understanding is, an iteration is required, such as Newton's Method (that isn't reliable when using complex numbers), but perhaps with some arbitrary precision all fractional exponents containing even numbered denominators can be excluded, so as not to need to import cmath (which is buggy in IDLE), nor have solutions containing complex numbers, since it can be implied that the solution to m lies in fact between two arbitrarily close rational numbers, ie. fractions with odd-numbered denominators??"

Or: How do I do this???

Thanks,
Charles


-- 


This message and any attachments may contain information that is privileged or confidential, and is intended solely for the addressee.  If you received this message in error, please notify the sender by reply e-mail and delete the message and any attachments.  Thank you.




More information about the tfug mailing list