[fpc-devel] FormatFloat bug

Michael Van Canneyt michael at freepascal.org
Wed May 30 11:56:14 CEST 2007

On Wed, 30 May 2007, Jonas Maebe wrote:

> On 30 mei 2007, at 11:10, Michael Van Canneyt wrote:
> >Not that I know of. As far as I know, it's left up to the CPU.
> >But it's been a long time since I looked at this, so I might
> >be wrong.
> The writing of floating point values does not use the rounding functionality
> provided by the FPU, it is implemented in a completely cpu-independent way.

Doesn't it use rounding ?

> Further, this program:
> var
>  c: currency;
> begin
>  c:=0.005;
>  writeln(c:0:2);
> end.
> writes 0.01. So it's probably a bug in one of the umpteen sysutils float
> formatting "helpers" (and if someone fixes it, please take into account that
> most cpus have comp=currency=int64, and that most do not support the extended
> types; there have been many bugs on different platforms in the past because of
> wrong assumptions about this in the past).

If it's not CPU stuff, then this is going to be messy :/


More information about the fpc-devel mailing list