Anda di halaman 1dari 1

Homework 1 : Numerical Methods

Submitted by : Allan Lambor Marbaniang


Roll No: 184040016
PhD

Statement :
To calculate the machine precision in single and double precision within a factor of ½.

Results :
The results of the algorithm gives a value of machine precision in Single precision = 5.960464x10-08
and Double precision = 1.110223x10-16

Comments:
The program is run in Matlab with the functions single ( ) and double ( ) able to change the precision
of the values stored to single and double precision respectively. A While loop statement with a
condition that : sum of 1 + eps >1 is made. The value of eps is decreased by half in each iteration ( As
the base pair is binary equal to 2) of the loop every time the condition is TRUE till the lowest precision
value is reached where the condition 1 + eps>1 is FALSE and comes out of the loop. The current value
of eps is the precision value.
In the program the names of variables eps are suffixed with SP and DP for single and double precision.

Anda mungkin juga menyukai