Why N[vector[[j]]] or NumberForm[vector[[j]]] not working? [closed]

Why is N not giving the approximate result (removing the .)?

vectorj = Table[j, {j, 0, 0.1, 0.01}]
N[vectorj[], 0]
(*out=0.*)

or

N[vectorj, 0]

or

NumberForm[vectorj[], 0]

Rationalize does the job.

closed as off-topic by Szabolcs, andre314, Alexey Popkov, m_goldberg, MarcoBApr 29 '17 at 2:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Szabolcs, andre314, Alexey Popkov, m_goldberg, MarcoB
If this question can be reworded to fit the rules in the help center, please edit the question.

• Use Round instead. N[x,0] would give a result with zero precision (i.e. something useless). Look up Precision. – Szabolcs Apr 28 '17 at 16:35
• What is the expected output of N[vectorj, 0]? – Kuba Apr 28 '17 at 16:46
• @Kuba expected output is 0 rather than 0. – Andrea G Apr 28 '17 at 16:47
• I know that, what about the rest of the list? – Kuba Apr 28 '17 at 18:06

It's the expected result from N. The result of N is an approximate result but not an exact result.

In:

vectorj = Table[j, {j, 0, 0.1, 0.01}]

N[vectorj[], 0] // Head

N[vectorj[], 0] // Accuracy
0 // Accuracy

Out:

{0., 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1}
Real
Integer
307.653
\[Infinity]

Workaround:

In:

xs = Table[x/100, {x, 0, 10, 1}]
xs // N

Out:

{0, 1/100, 1/50, 3/100, 1/25, 1/20, 3/50, 7/100, 2/25, 9/100, 1/10}
{0., 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1}