[fpc-devel] function IsInt64(Double): Boolean;

Martin Frb lazarus at mfriebe.de
Mon May 4 22:48:28 CEST 2026


On 04/05/2026 22:34, Ondrej Pokorny via fpc-devel wrote:
>
> I tried to switch overflow checks off:
> {$OVERFLOWCHECKS OFF}
>
> But obviously it doesn't help (it's a different exception).

AFAIK:
You need to use SetExceptionMask, I think the below example should do:


procedure DisableFloatExceptions;
begin
   if FloatExceptionLock = 0 then begin
     EM := GetExceptionMask;
     SetExceptionMask(EM + [exInvalidOp, exDenormalized, exZeroDivide, 
exOverflow, exUnderflow, exPrecision]);
   end;
   inc(FloatExceptionLock);
end;

procedure EnableFloatExceptions;
begin
   dec(FloatExceptionLock);
   if FloatExceptionLock <= 0 then begin
     FloatExceptionLock := 0;
     ClearExceptions(False);
     SetExceptionMask(EM);
   end;

end;




More information about the fpc-devel mailing list