Dear All
25 years ago I wrote a small database in Pascal for my A Level. 2 months ago I installed Lazarus as I wanted to code a form to create and edit a Playlist (.m3u) file, so as to save me manually writing playlist for my mp3 player. I completed it and am very happy. I have also coded in VB6, C, Python and C++, all to a low level and for fun.
I want to explore how to output a single to screen and did the following:
1) Declared a variable
DeciNum : single;
which as you will know holds a value from: 0.00000000000000000000000000000000000000000000015, up to 340000000000000000000000000000000000000.0
2) So I made the value of DeciNum the lowest value possible:
DeciNum := 0.00000000000000000000000000000000000000000000015;
3) Then I attempted to write this value to the screen:
writeln( 'DeciNum = ', DeciNum);
However the output was: ‘DeciNum = 0.000000000E+00’
4) I read up on the subject:
https://smartpascal.github.io/help/assets/floattostrf.htm5) Then I tried the following:
writeln( 'DeciNum = ', FloatToStrF( DeciNum, ffFixed, 2, 46 ) );
However the output was: ‘DeciNum = 0.000000000000000000
Not even the 46 decimal places?
What have I failed to understand?
Thanks, wait to hear
Stephanos
Windows 10, 64 bit
Free Pascal Lazarus Project, version2.0.6