Due to the finite precision in floating point number represe
Solution
Single-Precision Floating Point
MATLAB constructs the single-precision (or single) data type according to IEEE Standard 754 for single precision. Any value stored as a single requires 32 bits, formatted as shown in the table below:
Bits
Usage
31
Sign (0 = positive, 1 = negative)
30 to 23
Exponent, biased by 127
22 to 0
Fraction f of the number 1,f
Because MATLAB stores numbers of type single using 32 bits, they require less memory than numbers of type double, which use 64 bits. However, because they are stored with fewer bits, numbers of type single are represented to less precision than numbers of type double.
In MATLAB eps represents the precision of floating point numbers. Also it depends on the data type of the floating point numbers may be double or single.
In double, eps is 2^-52
In single, eps is 2^-23
Accordingly the eps value takes place.
Thus, MATLAB CANN’T RECOGNIZE A DIFFERENCE LESS THAN EPS.
Eps(1) is the smallest number such that 1+eps(1)>1.
For example 1+(1/2)eps(1)=1. That is addition of a number smaller than eps(1) does not make any changes. Difference between two numbers having distance less than eps(1) results in 0.
| Bits | Usage |
| 31 | Sign (0 = positive, 1 = negative) |
| 30 to 23 | Exponent, biased by 127 |
| 22 to 0 | Fraction f of the number 1,f |
