0

Suppose I solve an equation y=Solve[x+3==8,x]

and I want to get the numerical value of y, how do I do that? I mean, if I want to work with my result and evaluate, for example y-2 it will not work, because y is not in the form of a number, but rather {{y->3}}. How can I convert it into a number?

Thanks

1 Answers1

0

In:

(* #1 *)
Solve[x + 3 == 8, x] // Part[#, 1, 1, 2] &
(* #2 *)
Last @@ Last @@ Solve[x + 3 == 8, x] 
(* #3 *)
x /. # & @@ Solve[x + 3 == 8, x] 

Out:

5
5
5
webcpu
  • 3,182
  • 12
  • 17