In a floating-point system, ε
, also known as machine epsilon, is defined as the smallest value that can be added to 1.0 to obtain a value different from 1.0 in the system. The value of ε
depends on the number of bits used to represent the floating-point values and the internal representation of the system.
Given the floating-point system f=[a=2,k−=−6,k+=6,t=4]
, the distance between 1
and its right neighbor (ε1
) can be calculated using the formula:
main.m13 chars2 lines
Substituting the given values in the formula:
main.m37 chars2 lines
So the value of ε1
in the given floating-point system is 0.03125
(decimal).
In Matlab, you can calculate ε1
using the above formula as follows:
main.m49 chars4 lines
This will output 0.03125
as the value of ε1
.
gistlibby LogSnag