Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The calculator can raise a negative number to a fractional rational power with an odd denominator #2283

Open
raven-xr opened this issue Jan 25, 2025 · 0 comments

Comments

@raven-xr
Copy link

raven-xr commented Jan 25, 2025

Describe the bug
The calculator can raise a negative number to a fractional rational power, which is mathematically wrong. The function g(x) = x^(1/n) is only defined on the ray [0; +∞), because the following property a^(m/n) = ⁿ√(a^m) works for only positive numbers a > 0

P. S. The calculator works fine with even denominators and returns an error. I guess, the reason is that computers cannot execute the square root of a negative number

Steps To Reproduce

  1. Go to engineer mode
  2. Execute (-8)^(1/3) or something else, where the base is negative and the power is fractional rational with an odd denominator
  3. Get the answer

Expected behavior
The calculator has to return an error

Screenshots

last three images shows how it should be

Image

Image

Image

Image

Image

Image

Image

Device and Application Information

  • OS Build: Windows 10.0.19045.5371.0
  • Architecture: X64
  • Application Version: 11.2411.1.0
  • Region: ru-RU
  • Dev Version Installed: False

Additional context
Some people think that a^(m/n) = ⁿ√(a^m) for any value of a, but it's wrong. Let me explain...

Let's assume that a^(m/n) = ⁿ√(a^m) works for any numbers...

(-8)^(1/3) = (-8)^(1/3)
We know that (2a)/(2b) = a/b, so 1/3 = 2/6
Let's rewrite one of the expressions in a different way
(-8)^(1/3) = (-8)^(2/6)
It seems to be OK, so let's use the following property and rewrite the expression:
a^(n/m) = ⁿ√(a^m)
³√(-8) = ⁶√((-8)^2)
³√(-8) = ⁶√64
-2 = 2
And this is why we can't raise negative numbers to a fractional rational power and why a^(m/n) = ⁿ√(a^m) doesn't work for negative numbers.

Now, let a be zero, then:
0^(-2/3) = ³√(0^(-2)) = ³√(1/0)
So this rule also doesn't work for a = 0

Requested Assignment
I'm just reporting this problem. I don't want to fix it.

@raven-xr raven-xr changed the title Raising a negative number to a fractional rational power The calculator can raise a negative number to a fractional rational power with an odd denominator Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant