Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Negative numbers and fractional powers Flexico Programmer named Tim Posts: 16 Threads: 7 Joined: Dec 2016 Reputation: 0 Likes received: 0 #1 Dec-08-2016, 03:32 PM Python doesn't like it when I ask it things like, (-6)**(1/3). I can at least get some answer by changing it to (-6+0j)**(1/3), and it gives me a complex answer, but that's not quite complete, because in the complex plane, numbers have three cube roots. I can get multiple roots usingÂ [mpmath.root(a,b,k) for k in range(b)] (returning a**(1/b)), but that only works for whole-number roots, rather than arbitrary real exponents. Is there a function out there somewhere that can give me every solution to an arbitrary a**b? I already use Sympy, so it would be great if it could work symbolically to give exact answers. Larz60+ aetate et sapientia Posts: 7,950 Threads: 293 Joined: Sep 2016 Reputation: 308 Likes received: 1083 #2 Dec-08-2016, 04:12 PM possibly Sage? http://www.sagemath.org/ « Next Oldest | Next Newest »

Top Page

 Possibly Related Threads... Thread Author Replies Views Last Post Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 303 May-09-2019, 12:19 PM Last Post: Pleiades comparing fractional parts of floats Skaperen 4 429 Mar-19-2019, 03:19 AM Last Post: casevh Positive to negative bernardoB 6 429 Mar-13-2019, 07:39 PM Last Post: bernardoB negative to positive slices Skaperen 3 1,064 Jan-29-2018, 05:47 AM Last Post: Skaperen Replace only '-' values with NaN, don't remove minus sign for negative numbers. rajpython 2 2,159 Sep-10-2017, 01:23 PM Last Post: ichabod801 Negative lookahead not working, help please MitchBuchanon 8 2,363 Mar-01-2017, 02:41 PM Last Post: Ofnuts Fractional Exponent Question Flexico 2 1,992 Dec-04-2016, 01:00 AM Last Post: Flexico

Forum Jump:

Users browsing this thread: 1 Guest(s)