|
@@ -1757,10 +1757,17 @@ end;
|
|
|
|
|
|
|
|
|
|
{$ifndef FPC_SYSTEM_HAS_FRAC}
|
|
{$ifndef FPC_SYSTEM_HAS_FRAC}
|
|
- function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
|
|
|
|
- begin
|
|
|
|
- result := d - Int(d);
|
|
|
|
- end;
|
|
|
|
|
|
+function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
|
|
|
|
+ var
|
|
|
|
+ i: integer;
|
|
|
|
+ begin
|
|
|
|
+ i := (float64high(d) and $7ff00000) shr 20;
|
|
|
|
+ if i=$7FF then
|
|
|
|
+ { return NaN }
|
|
|
|
+ result := (d-d)/0.0
|
|
|
|
+ else
|
|
|
|
+ result := d - Int(d);
|
|
|
|
+ end;
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
|
|
|