[fpc-devel] FormatFloat

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Dec 30 16:44:07 CET 2009


On 30 Dec 2009, at 17:27, darekm at emadar.com wrote:

> this program:
> var
>  d1,d2 : double;
> begin
>  d1:=105;
>  d2:=1.05e2;
>  writeln(d1-d2);
> end;

That's only part of a program, it does not compile. You may have typed it in your mail and accidentally put a ";" at the end instead of a ".", but that still means that the program you tested was probably different from what you wrote above.

> result: 6.9388939907E-18
> 
> is this bug?

With which FPC version on which platform and with which test program do you get this result? Did you use any special options to compile the RTL or compiler? When I fix the above code to end with a "." instead of with a ";", I get " 0.00000000000000E+000" with FPC 2.2.4, 2.4.0 and 2.5.1 on different platforms (Mac OS X/ppc, Mac OS X/i386, Linux/i386).


Jonas


More information about the fpc-devel mailing list