[fpc-pascal] float calculates rubbish

Marc Santhoff M.Santhoff at t-online.de
Sun Mar 6 23:25:44 CET 2005


Am So, den 06.03.2005 schrieb Marco van de Voort um 23:02:
> > $ ./testlongfloat
> > 1109081216
> > 1109081216.00
> > 554540608
> > 554540608.00
> > 
> > Am I producing a value overflow here or what's happening? The whole
> > thing is running on i386 with fpc 1.9.4.
> 
> glib redefined float as 32-bit single, which has much lower precision, which
> in turn causes the rounding.
> 
> Try recompiling the above test without glib, but with math (which contains
> the Delphi/FPC float definition).

Ah, I see. And the good one (math) wins, if its last in the row, so if I
want to use anything the way it is, I can add the math unit as last in
the row or at least after gdk and it'll work as expected in its number
range.

Maybe gdk will have some problems where it is expects float aka single
as parameter and is fed with double or extended...

Thanks,
Marc






More information about the fpc-pascal mailing list