# Floating Point Arithmetics

I have been experimenting with understanding floating-point arithmetic. I have a 64-bit processor. I have asked Matlab to use format longe, which should display a floating-point with doubt precision.

I see that $$3.16229-3.16228=1.000000000006551e-05$$ while $$.316229*10^3-.316228*10^3=9.999999999763531e-04$$

I am not able to understand the difference. Is it because these numbers will be converted to binary representation for calculations, and then truncated to 52 bits. If yes, why the above two representations give different answers.

• This belongs on Stack Overflow. I'm flagging this to mods. – K.defaoite Aug 2 '20 at 2:33