# Convert Integer to Real

Is there a preferred way of converting an Integer to a Real?

What I'm using at the moment is x + 0.0.

-
N is what I use. –  Michael E2 Oct 15 '13 at 19:20
@MichaelE2 your chance to post a canonical answer using one character ;-) –  Yves Klett Oct 16 '13 at 5:24
Although the answer is trivial, there is no one-hit wonder on google or in the documentation. The first immediately useful hit is reference.wolfram.com/legacy/v2/contents/3.1.2.pdf, which is already running under "legacy", so I would vote against closure as long as @MichaelE2 posts his comment as answer. –  Yves Klett Oct 16 '13 at 7:57
@yvesklett I was about to vote to close, but you're right, unfortunately. I have been trying to find an answer to this question as if I were a newbie. There just doesnt seem to be an easy and intuitive way a new user could arrive at the answer, at least not from the online documentation. –  Sjoerd C. de Vries Oct 16 '13 at 9:33
@SjoerdC.deVries my first reflex was also to close (as in quite a few cases these last days). It may be a duplicate, but in fact this title question and the straightforward answer may be even more useful for newbies. –  Yves Klett Oct 16 '13 at 11:29

N

A one-character answer is disallowed by SE, so I will expand. N is mostly what I use. If I have an expression like $2 x + 3$, I sometimes write it 2. x + 3. in Mathematica; then if x is numeric, whether it happens to be an Integer or not, the expression will always be Real or Complex.

-
Indeed, the last part of the statement is always true, my bad. Well... actually, if x is something completely different..... :) –  István Zachar Oct 16 '13 at 11:17
Head /@ {23, 23*1, 23/1, 23 + 0, 23., 23*1., 23/1., 23 + 0.}


{Integer, Integer, Integer, Integer, Real, Real, Real, Real}

-

This also

{Head[1], Head[1 // N]}


{Integer, Real}

-