瀏覽代碼

* improved fpc_frac_real

florian 3 年之前
父節點
當前提交
04145589a9
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      rtl/inc/genmath.inc

+ 2 - 4
rtl/inc/genmath.inc

@@ -1758,11 +1758,9 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_FRAC}
 function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
-  var
-    i: integer;
   begin
-    i := (float64high(d) and $7ff00000) shr 20;
-    if i=$7FF then
+    { Nan or +/-Inf }
+    if (float64high(d) and $7ff00000)=$7ff00000 then
       { return NaN }
       result := (d-d)/0.0 
     else