Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-03

softfloat bug?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Henry Vermaak

hi everyone

fpc with softfloat seems to work quite well on arm (le). i've run into a strange problem, though. i've got code that looks like this:

  writeln(stderr, 'gain is ', round(scan.avge.tip.gain * 100));
  writeln(stderr, 'gain is ', format('%.0f', [scan.avge.tip.gain * 100]));

sometimes i get an eoverflow exception on the second line. this depends on the value of scan.avge.tip.gain. here's a trace - might not be very helpful:

gain is -10
An unhandled exception occurred at $0001D73C :
EOverflow : Floating point overflow
$0001D73C FLOAT_RAISE, line 111 of
/home/hcv/freepascal/latest/rtl/inc/genmath.inc
$000182E8 float64_mul, line 4387 of
/home/hcv/freepascal/latest/rtl/inc/softfpu.pp
$00021858 STR_REAL, line 361 of
/home/hcv/freepascal/latest/rtl/inc/real2str.inc
$000266C4 fpc_ansistr_float, line 862 of
/home/hcv/freepascal/latest/rtl/inc/astrings.inc
$00060978 FLOATTOSTRFINTL, line 1249 of
/home/hcv/freepascal/latest/rtl/objpas/sysutils/sysstr.inc $00061C78 FLOATTOSTRF, line 1505 of
/home/hcv/freepascal/latest/rtl/objpas/sysutils/sysstr.inc $0005E89C FORMAT, line 250 of
/home/hcv/freepascal/latest/rtl/objpas/sysutils/sysformt.inc $0005F854 FORMAT, line 895 of
/home/hcv/freepascal/latest/rtl/objpas/sysutils/sysstr.inc $0000A4C8 INITTAGRESULTARRAY, line 325 of repgen.lpr $0000D94C PROCESSFILE, line 603 of repgen.lpr
$000102B4 main, line 819 of repgen.lpr

any help would be appreciated!

thanks
henry

Terry Kemp
to Henry Vermaak
Henry Vermaak wrote
update: this happens if i try FloatToStrf of any negative number. works with positive numbers, though. henry

If it helps to isolate problem (anyone?)...
it seems to work if the variable is declared as float type 'currency' but not for any other type. However any / or * operation returns runtime error 207.

Terry