Problem with softfloat in fpc for ARM using negative number

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem with softfloat in fpc for ARM using negative number

josepascual (almudi)
Hi

When I run next floattest program

program floattest;

uses sysutils;
var a,b,c:double;

begin
a:=0.5;
b:=0.3;
writeln(format('%5.3f',[a*b]));
a:=-0.5;
c:=a*b;
writeln(format('%5.3f',[c]));
end.

I received this output:
===================== output =================================
0.150
An unhandled exception occurred at $0000D550 :
EOverflow : Floating point overflow
  $0000D550  FLOAT_RAISE,  line 111 of /opt/fpc/svn/fpc/rtl/inc/genmath.inc
  $0000B728  float64_mul,  line 4389 of /opt/fpc/svn/fpc/rtl/inc/softfpu.pp
  $0000E590  STR_REAL,  line 361 of /opt/fpc/svn/fpc/rtl/inc/real2str.inc
  $00010EB0  fpc_ansistr_float,  line 891 of
/opt/fpc/svn/fpc/rtl/inc/astrings.inc
  $0001B89C  FLOATTOSTRFINTL,  line 1249 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $0001C4A4  FLOATTOSTRF,  line 1505 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $0001A078  FORMAT,  line 250 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysformt.inc
  $0001B030  FORMAT,  line 895 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $000081E8  main,  line 13 of floattest.pas
===================== output =================================

if I change from double to single I obtain the same output, Is single
implemented as double?

Jose Pascual

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal