Re: [fpc-pascal] float calculates rubbish

2005-03-06 Thread Marc Santhoff
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-

Re: [fpc-pascal] float calculates rubbish

2005-03-06 Thread Marco van de Voort
> $ ./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.

[fpc-pascal] float calculates rubbish

2005-03-06 Thread Marc Santhoff
Hi, i was confused and defined some real values as float in a GTK program. GDK (glib.pp) defines float as single. Look what happened: program testlongfloat; uses sysutils, glib; const c1: float = 1109081270; c2: float = 1109081270 / 2; BEGIN writeln(inttostr(trunc((c1