I have 2 variables, x
and y
.
I am doing z = x^y
.
Now assuming I know only z
and y
, How can I get x
back? Is there an opposite to ^
in JavaScript?
I have 2 variables, x
and y
.
I am doing z = x^y
.
Now assuming I know only z
and y
, How can I get x
back? Is there an opposite to ^
in JavaScript?
- Try this at stackoverflow./questions/4540422/… – asiby Commented Aug 5, 2013 at 20:54
2 Answers
Reset to default 17Yes, ^
is its own inverse.
x == (x^y)^y
Given z=x^y
You can get x
by doing x=z^y