Sign in Join

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

Mailing lists / fpc-pascal / 2007-07

Problem with softfloat in fpc for ARM using negative number

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

josepascual

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