0
program Project1;

var p : real;

const s=439 ;

begin
     p:=s/100;
     Write(p);
     ReadLn;
end.

Output of the above code is expected to be 4.39, but this gives 4.3899999999999997E+000. Where do these additional 89999999 came from? How to omit this and get the correct answer? Thanks in advance!

P.S. If we assign s = 433 it gives the expected output as 4.3300000000000001E+000. My issue is, how this division can be number related?

Edit: I want to know a remedy to overcome this inaccuracy. It may be a code line or two, what ever possible to get rid of this issue.

0 Answers0