Re: [fpc-pascal] Floating point question

2024-01-28 Thread Bernd Oppolzer via fpc-pascal
To simplify the problem further: the addition of 12 /24.0 and the subtraction of 0.5 should be removed, IMO, because both can be done with floats without loss of precision (0.5 can be represented exactly in float). So the problem can be reproduced IMO with this small Pascal program: program T

Re: [fpc-pascal] Floating point question

2024-01-28 Thread Bart via fpc-pascal
On Sun, Jan 28, 2024 at 10:21 AM Bernd Oppolzer via fpc-pascal wrote: > The problem now is: > > the printout of my value suggest an accuracy which in fact is not there, Which is because I was too lazy to cater for that. Notice the :20:20 in the writeln statement: I tell the compiler how many di