FMX disables floating div by zero exception. VCL does not. Is this intended?

FMX disables floating div by zero exception. VCL does not. Is this intended?

procedure TForm20.FormCreate(Sender: TObject);
var
i: Integer;
tmp:Single;
begin
Caption:=Default8087CW.ToString+' '+Get8087CW.ToString;

i:=0;
tmp:=10/i;
end;

Some debugging shows this happens at System.Win.InternetExplorer initialization and also at TCustomCanvasD2D.TryCreateDirect3DDevice procedure. FMX sets 8087 control word to $137F, while VCL sets $1372



Comments

  1. Oh crap. All those Delphi libraries thinking the CW is the default that has been used for 2 decades are now on their wrong foot.

    ReplyDelete
  2. It's not really FMX that does this. It's the external libraries. This sort of thing is a problem on VCL too. As I have discussed ad nauseum, the Delphi runtime does a poor job of making sense of the minefield that is floating point control state. I'm afraid Embarcadero has made it clear by their inaction in this area that they simply do not care. Developers are going to need to understand the issues and work around them for themselves.

    ReplyDelete
  3. Neither of those approaches sound practical

    ReplyDelete

Post a Comment