mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-25 18:01:53 +02:00
* ensure always an exception is raised in genmath.inc if appropriate
This commit is contained in:
parent
072f1bfb29
commit
f72183eb37
@ -989,7 +989,7 @@ end;
|
|||||||
if( d <= 0.0 ) then
|
if( d <= 0.0 ) then
|
||||||
begin
|
begin
|
||||||
if d < 0.0 then
|
if d < 0.0 then
|
||||||
result:=(d-d)/zero
|
result:=zero/zero
|
||||||
else
|
else
|
||||||
result := 0.0;
|
result := 0.0;
|
||||||
end
|
end
|
||||||
@ -1439,7 +1439,7 @@ end;
|
|||||||
{ if we have to check manually fpu exceptions, then force the exit statements here to
|
{ if we have to check manually fpu exceptions, then force the exit statements here to
|
||||||
throw one }
|
throw one }
|
||||||
{$CHECKFPUEXCEPTIONS+}
|
{$CHECKFPUEXCEPTIONS+}
|
||||||
{ turn off fastmath as it converts (d-d)/zero into 0 and thus not raising an exception }
|
{ turn off fastmath as it converts zero/zero into 1 and thus not raising an exception }
|
||||||
{$OPTIMIZATION NOFASTMATH}
|
{$OPTIMIZATION NOFASTMATH}
|
||||||
begin
|
begin
|
||||||
hx := float64high(d);
|
hx := float64high(d);
|
||||||
@ -1451,7 +1451,7 @@ end;
|
|||||||
if (((hx and $7fffffff) or longint(lx))=0) then
|
if (((hx and $7fffffff) or longint(lx))=0) then
|
||||||
exit(-two54/zero); { log(+-0)=-inf }
|
exit(-two54/zero); { log(+-0)=-inf }
|
||||||
if (hx<0) then
|
if (hx<0) then
|
||||||
exit((d-d)/zero); { log(-#) = NaN }
|
exit(zero/zero); { log(-#) = NaN }
|
||||||
dec(k, 54); d := d * two54; { subnormal number, scale up x }
|
dec(k, 54); d := d * two54; { subnormal number, scale up x }
|
||||||
hx := float64high(d);
|
hx := float64high(d);
|
||||||
end;
|
end;
|
||||||
@ -1762,7 +1762,7 @@ end;
|
|||||||
{ if we have to check manually fpu exceptions, then force the result assignment statement here to
|
{ if we have to check manually fpu exceptions, then force the result assignment statement here to
|
||||||
throw one }
|
throw one }
|
||||||
{$CHECKFPUEXCEPTIONS+}
|
{$CHECKFPUEXCEPTIONS+}
|
||||||
{ turn off fastmath as it converts (d-d)/zero into 0 and thus not raising an exception }
|
{ turn off fastmath as it converts zero/zero into 0 and thus not raising an exception }
|
||||||
{$OPTIMIZATION NOFASTMATH}
|
{$OPTIMIZATION NOFASTMATH}
|
||||||
{$endif VER3_2}
|
{$endif VER3_2}
|
||||||
function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
|
function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user