# Using numerical value of Solve [duplicate]

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

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

• Or y = Solve[x + 3 == 8, x][[1, 1, 2]] less typing :) – pfactors Apr 27 '17 at 18:15
• Last @ Reduce[x + 3 == 8] – UnchartedWorks Apr 27 '17 at 18:30
• No competition Uncharted, just pointing out that your first example can be shortened :) – pfactors Apr 27 '17 at 18:34
• :) I know. It's just for fun. – UnchartedWorks Apr 27 '17 at 18:40
• Okay then! Good to see someone with a passion for anonymous functions and the apply function, continue sir :) – pfactors Apr 27 '17 at 18:54