Sign in Join

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

Mailing lists / fpc-devel / 2012-07

TryStrtoFloat - Bug?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Marcel Märtens

Hello,
i think i've found a bug in the procedure TryStrtoFloat. To get this bug, create a new project and run this lines (i'm using a button to run the line, but it shouldn't matter)

---------------------------------------------------
var
   areal:real;
begin
TryStrtoFloat('86E6722INVALID!',areal);
end;
---------------------------------------------------

"86E6722" is a valid number, which is out of range and creates an error. The whole text is not a valid number, but it also creates an error. It raises an "External: SIGFPE" error.

B.t.w.: "TryStrToInt('86E6722INVALID!',aint);" or "TryStrToInt('86E6722',aint);" raises no error, they just return false.

Thanks.
Marcel Märtens

---------------------------------------------------------------------------- Lazarus 1.1 r37649 FPC 2.6.1 i386-win32-win32/win64 Win 7 64bit - FPC 32 bit

Reply by email