[fpc-devel] FormatFloat bug

Michael Van Canneyt michael at freepascal.org
Tue May 29 20:58:28 CEST 2007



On Tue, 29 May 2007, Graeme Geldenhuys wrote:

> On 5/29/07, Joao Morais <post at joaomorais.com.br> wrote:
> > Graeme Geldenhuys wrote:
> >
> > > Hi,
> > >
> > > Attached is a application that demonstrates a bug in FormatFloat.  All
> > > tests pass when run under Delphi, but test four fails under Free
> > > Pascal.
> >
> > IMHO, fpc behaves correctly. 0.005 is closer than 0 instead 0.01. If you
> > try 0.00500000001, you will have 0.01, also correct.
> >
> 
> 
> What rounding does FormatFloat() use so I can see if it is
> mathematically correct and how compatible do we want to be with
> Delphi?

If I remember correctly: 
Bookkeepers rounding as implemented by the Intel processors.
No own routines are used. It's left up to the processor.

Michael.



More information about the fpc-devel mailing list