Menu

#4841 polarform: integer vs. rational exponent inconsistency

None
open
nobody
5
12 hours ago
13 hours ago
No

Spotted by Claude:

In the float case, we have -%pi, in the rational case, we have %pi:

(%i1) assume(a > 0, b > 0)$

(%i2) polarform((-a)^0.5 * (-b)^0.5);
(%o2) %e^-(1.0*%i*%pi)*a^0.5*b^0.5

(%i3) polarform((-a)^(1/2) * (-b)^(1/2));
(%o3) %e^(%i*%pi)*sqrt(a)*sqrt(b)

Discussion

  • David Scherfgen

    David Scherfgen - 12 hours ago

    This is actually about carg rather than polarform.
    Note that the documentation for carg says:

    The complex argument is an angle theta in (-%pi, %pi]

    So -%pi should not occur (exclusive endpoint). The float answer is wrong.

     

    Last edit: David Scherfgen 12 hours ago
  • David Scherfgen

    David Scherfgen - 12 hours ago
    • labels: polarform --> polarform, carg
     

Log in to post a comment.

MongoDB Logo MongoDB