What you describe sounds like it is just a display issue. Earlier versions of MATLAB on PC machines used a library print function that only printed significant digits. Later versions of MATLAB on PC machines switched to a library function that prints all of the requested digits in an exact binary floating point to decimal sense ... but still only about 15-16 of those digits are significant. The underlying double precision arithmetic and storage is the same. I don't recall the exact MATLAB version when they made the switch, but I can look it up to confirm.
Results on PCWIN64 R2017a:
||I - Q'*Q|| = 4.1017407521273323000000000000000000000000000000000000000000000000e-16
||Q*R - X|| = 1.7763568394002505000000000000000000000000000000000000000000000000e-15
>> num2strexact(norm(eye(2) - Q'*Q))
ans =
'4.1017407521273322775592436112613973088682572487422006712876054734806530177593231201171875e-16'
>> num2strexact(norm(Q*R - X))
ans =
'1.7763568394002504646778106689453125e-15'
Results on PCWIN64 R2017b:
||I - Q'*Q|| = 4.1017407521273322775592436112613973088682572487422006712876054735e-16
||Q*R - X|| = 1.7763568394002504646778106689453125000000000000000000000000000000e-15
>> num2strexact(norm(eye(2) - Q'*Q))
ans =
'4.1017407521273322775592436112613973088682572487422006712876054734806530177593231201171875e-16'
>> num2strexact(norm(Q*R - X))
ans =
'1.7763568394002504646778106689453125e-15'
Results on PCWIN64 R2019a:
||I - Q'*Q|| = 4.1017407521273322775592436112613973088682572487422006712876054735e-16
||Q*R - X|| = 1.7763568394002504646778106689453125000000000000000000000000000000e-15
>> num2strexact(norm(eye(2) - Q'*Q))
ans =
'4.1017407521273322775592436112613973088682572487422006712876054734806530177593231201171875e-16'
>> num2strexact(norm(Q*R - X))
ans =
'1.7763568394002504646778106689453125e-15'
So you can see that it is just a display issue, and the display change came in R2017b. The underlying calculations actually produce the exact same result in all three versions. (num2strexact is a mex routine that prints the exact binary floating point to decimal conversion)
But, regardless of how many decimal digits actually get printed, the double floating point arithmetic in the background is the same on your machine as it is on hers.
Best Answer