Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7836273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:03:57+00:00 2026-06-02T14:03:57+00:00

Ok, so I’ve gathered from this question that when you take pow() using a

  • 0

Ok, so I’ve gathered from this question that when you take pow() using a negative number with a non-integral exponent, the result is NaN.

So my question is: Is there some alternative method I can use to get an answer? I just want to be able to do things like this:

MyPowFunction(-3125, 0.2);

and have the result be (correctly) -5.

Any thoughts?


As an addendum, it is possible to do this (somehow). Google has it figured out: https://www.google.com/search?q=%28-3125%29%5E0.2&oq=%28-3125%29%5E0.2


One more note: I’m not interested in a double result–I’m perfectly fine with the result being complex.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:03:59+00:00Added an answer on June 2, 2026 at 2:03 pm

    If a is positive and b is (complex) arbitrary, then one may define a^b as exp(b log a). This extends directly the case where b is a rational number.

    Now, if a is complex (but nonzero), one may define a^b by analogy (proper term is “analytic continuation”) as exp(b Log a), where Log is one possible inverse of exp.

    For instance, one possible Log function (there are infintely many, differing by multiples of 2 i pi) is

    Log z = log |z| + i(arg z + 2k pi), k as you wish
    

    Check that for any k, this gives an inverse to exp (I skip the details about the domain of definition: just pretend there is only one z, and we want to find Log z such that exp(Log z) = z).

    The way you choose k will thus influence the answer. If b is irrational, then

    "a^b" = exp(b Log a) = exp(ib arg a) * exp(2i k pi * b) * |a|
    

    and since k can be arbitrary, exp(2i k pi * b) can be arbitrary close to whatever number you want on the unit circle (unit circle = numbers with unit modulus), there are infinitely many values of “a^b” possible.

    If b is rational (like 0.2 = 1/5 in your example), then you’ll get 5 different candidates for a^0.2 (one of which is real).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.