According to this page
http://wiki.lazarus.freepascal.org/Variables_and_Data_Typesthe "extended" real type has 19-20 significant digits, but in my function it seems to be less:
eg.
procedure TForm1.Button3Click(Sender: TObject);
var the_nr: extended;
begin
the_nr:= (1000/1001);
showmessage(floattostr(the_nr));
end;
running the above function shows "0.99900099900099"
if "extended" has 19-20 significant digits, shouldn't there be at least another 9 on the end?
eg. 0.999000999000999 or 0.999000999000999001 ?
Is it something to do with using floattostr - does that only work up to 15-16 significant digits because it can only use up to "double" instead of "extended"? Should I be using something other than floattostr to convert an extended to a string keeping all 19-20 significant digits (is there a function that does or would I need to write one?)?
edit: just found it it
is the floattostr function that is causing the reduced precision as I've now half-written a (not very good) function to convert an extended to string. So I wondered if there is a better/
standard way to convert an extended to string without losing precision?