File tree 1 file changed +11
-13
lines changed
PythonForDelphi/Components/Sources/Core
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -3168,7 +3168,7 @@ procedure MaskFPUExceptions(ExceptionsMasked : boolean;
3168
3168
implementation
3169
3169
3170
3170
{ $IFDEF MSWINDOWS}
3171
- uses Registry;
3171
+ uses Math, Registry;
3172
3172
{ $ENDIF}
3173
3173
3174
3174
@@ -9732,19 +9732,17 @@ function PyType_HasFeature(AType : PPyTypeObject; AFlag : Integer) : Boolean;
9732
9732
procedure MaskFPUExceptions (ExceptionsMasked : boolean;
9733
9733
MatchPythonPrecision : Boolean);
9734
9734
begin
9735
- { $IFNDEF CPUARM}
9736
- if MatchPythonPrecision then begin
9737
- if ExceptionsMasked then
9738
- Set8087CW($1232 or $3F )
9739
- else
9740
- Set8087CW($1232 );
9741
- end else begin
9742
- if ExceptionsMasked then
9743
- Set8087CW($1332 or $3F )
9735
+ if ExceptionsMasked then
9736
+ SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,
9737
+ exOverflow, exUnderflow, exPrecision])
9738
+ else
9739
+ SetExceptionMask([exDenormalized, exUnderflow, exPrecision]);
9740
+ { $IFNDEF NEXTGEN}
9741
+ if MatchPythonPrecision then
9742
+ SetPrecisionMode(pmDouble)
9744
9743
else
9745
- Set8087CW($1332 );
9746
- end ;
9747
- { $ENDIF}
9744
+ SetPrecisionMode(pmExtended);
9745
+ { $ENDIF !NEXTGEN}
9748
9746
end ;
9749
9747
9750
9748
{ $IFDEF MSWINDOWS}
You can’t perform that action at this time.
0 commit comments