I'm new on Matlab, and I have a question. Can I represent recurring decimals? For example I want to operate 216.6666666… by another number.
I'll appreciate your answers.
I'm new on Matlab, and I have a question. Can I represent recurring decimals? For example I want to operate 216.6666666… by another number.
I'll appreciate your answers.
As Matlab is just a numerical software this is a senseless question because with machine precision recurring decimals are uninteressting. As I am not that confident with the syntax you could try something like \[ \sum_{k=1}^\infty \frac{b}{(10^p)^k}\] where $b$ is the recurring number and $p$ is the amount of digits.
If it's absolutely necessary, I suggest using a toolbox to extend to arbitrary precision, and then use a loop to extend this to as far as you want.
However, by default, MATLAB uses standard binary floating point representation. So, you're limited to either 32 or 64 bits of precision. (I forget which.) Thus, you won't really be able to represent a repeating decimal to infinite precision.
That said, MATLAB is pretty good with roundoff error--if I recall correctly, (1/3)*3 still returns 1.
As far as I'm aware there is no direct way to represent a recurring decimal.
However, if I interpret your question as "what is a way to represent $216.\dot{6}$ with very high precision", then it would be something like this:
x = 216 + (1/9)*6;
There are probably hacks to get slightly higher precision, but this should suffice for most purposes I can imagine.