It is supposed that Matlab uses binary floating point arithmetic, so we should expect that it could recognise exact binary numbers with no error. Look at the example:

>> format rat;i=[0:1:11];y=100+(96+2.*i)/(2^10);y'

ans =

3203/32

9409/94

4104/41

26126/261

12813/128

2903/29

25627/256

12113/121

6407/64

51257/512

5306/53

26931/269

The correct numbers can be found at Table 2 of page 15 from the attached Ebook (it is in greek, but tables are in english), where you can also compare the absolute accuracy of Octave in contrast to the errors of Matlab.

Book Σημειώσεις Εργαστηρίου Γραμμικών Μαθηματικών

More Demetris Christopoulos's questions See All
Similar questions and discussions