Y
Hacker News
new
|
ask
|
show
|
jobs
by
yorwba
99 days ago
For x = -i, square(x) = -1, sqrt(square(x)) = i. Meanwhile, abs(x) = 1. You're right that it simplifies to abs(x) for real x, but that no longer holds for arbitrary complex values.
1 comments
NooneAtAll3
99 days ago
for arbitrary complex values sqrt() gives 2 answers with +- signs
so sqrt(square(-i)) = +-i, one of which is x
link
syockit
99 days ago
I've never seen a CAS that gives two answers for sqrt. Mathematica doesn't, sympy doesn't, and IIRC Maxima also doesn't.
link
Armisael16
99 days ago
The sqrt function returns the principle square root, not both. That’s true for all numbers, positive, negative, and complex alike.
link
so sqrt(square(-i)) = +-i, one of which is x