For example, if I'm in Z5, $-2$ is equivalent to $3$ which is equivalent to $8$. Also, the value of $x$ in the equation $4x = 2$ is $3$.
Note how any integer can be written as an integer that is within $\Bbb Z_5$ (ex. $-2$ and $8$ can both be written as $3$). This is how I solve arithmetic problems within certain $\Bbb Z_n$s: I find the answer normally, and then convert that answer to something that lies within the $\Bbb Z_n$ I'm working in.
For example, normally, $5 + 3 = 8$. But in $\Bbb Z_5$, $5 + 3 = 3$. I can solve this successfully using my method: first I find the answer normally (and get $8$), then I convert that answer to its $\Bbb Z_5$ form and get the answer I want (which is $3$).
The only time where I can't do this is when the answer is a decimal. Take the above equation for example. Normally, $4x = 2$ would tell you that $x = \frac 1 2$. But $\frac 1 2$ is actually already within $\Bbb Z_5$, but it is not equivalent to $3$, so my method did not give me the right answer in this scenario.
Is there some kind of flaw in my thinking that results in my method not working with decimals? What would the value of $\frac 1 2$ actually be over $\Bbb Z_5$? Do decimals not exist at all over any $\Bbb Z_n$?
Any help is greatly appreciated!