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.
On
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 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.