Sign in Join

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

Mailing lists / fpc-pascal / 2016-08

{$FINITEFLOAT OFF}

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

LacaK

Hi,

does we have in FPC something like Delphi {$FINITEFLOAT OFF} ? If not can be implemented in future ?

I am trying to avoid FPU exception in case of underflow or overflow values.

I have this test code:

   d := 30000; // + or -
   d := 1/(1+exp(-1*d)); // here I get SIGFPE exception (my guess is
that it is caused by value underflow -INF or overflow +INF

What can I do in this case ?
I did:

   SetExceptionMask(GetExceptionMask() + [exUnderflow,exOverflow]);

It seems to work, but it depends on Math unit, which I want to avoid.

Then I did:
   CW := Get8087CW;
   SSECW:=GetSSECSR;
   Set8087CW(CW or $18); // mask underflow,overflow
   SetSSECSR((SSECW and $ffffe07f) or (dword($58) shl 7));

It works for Win32, but not for Win64 ?

TIA
-Laco.

Reply by email