
Fractional power of negative numbers enclosed in parentheses

alfredzong
• print -0.5^2.1 -0.233258 • print (-0.5)^2.1 NaN • print (-0.5)^2.0 0.25 • print -0.5^2.0 -0.25
I am getting a NaN for calculating the fractional power of a negative number if the number is enclosed in a parenthesis, which is rather weird. If the exponent is an integer, the behavior is intended. Please see above snippet from the Igor Pro command window. I'm running on Igor Pro 8.04 (Build 34722) with MacOS 15.5.
I would appreciate any suggestions to solve this issue.
I think this behavior is correct, since, in essence, you are producing a complex number but the standard print is real. See:
June 19, 2025 at 05:48 pm - Permalink
Aha, that's right. Thanks chozo!
June 19, 2025 at 06:21 pm - Permalink
You can read about Igor's operators and their precedence: DisplayHelpTopic "Operators"
June 20, 2025 at 11:51 am - Permalink