"meena rao" <meenaraos@yahoo.co.in> wrote in message <iqcevu$mqk$1@newscl01ah.mathworks.com>...
> ......
> Is the value in the workspace of lamda1 is right. .....
> ......
        
Meena, it is very important for Matlab users to understand the difference between the actual binary floating point value of a quantity stored within memory and a displayed approximate decimal representation of that quantity. The stored value is what is actually used in computation, while the displayed value is only an approximate indication of its value for the user's benefit.
As John has indicated, the accuracy of such displays is controlled by the 'format' setting. The default "format short" gives four digits after the decimal point while "format long" for example gives about 14 places after the decimal point (for 'double' numbers.) The only one of the 'format' settings that is guaranteed to give the precise value is "format hex", but unfortunately that is difficult to interpret for persons accustomed to decimal numbers.
Here's an example using the quantity 'pi'. With the default "format short" it is displayed as "3.1416", with "format long" it is shown as "3.14159265358979", and with "format hex" it appears as a rather mysterious "400921fb54442d18". Only this last is a precise representation of the true stored value. If this were given as a binary fraction it would be the mindboggling 53bit number:
1.1001001000011111101101010100010001000010110100011000
and this is what actually would be used in computation with 'pi'. This should show you why more compact representations are desirable for display purposes.
(Of course, since the true mathematical pi is a transcendental number, even the above binary number is only an approximation accurate to 53 bits  the best that double precision floating point can do.)
Roger Stafford
