Sfoglia il codice sorgente

* get rid of sysutils use in the math unit

florian 1 anno fa
parent
commit
3181f1f35c
2 ha cambiato i file con 1 aggiunte e 29 eliminazioni
  1. 0 28
      rtl/objpas/math.pp
  2. 1 1
      tests/webtbs/tw12214.pp

+ 0 - 28
rtl/objpas/math.pp

@@ -52,15 +52,7 @@ unit Math;
 {$ENDIF FPC_DOTTEDUNITS}
 interface
 
-
 {$ifndef FPUNONE}
-{$IFDEF FPC_DOTTEDUNITS}
-    uses
-       System.SysUtils;
-{$ELSE FPC_DOTTEDUNITS}
-    uses
-       sysutils;
-{$ENDIF FPC_DOTTEDUNITS}
 
 {$IFDEF FPDOC_MATH}
 Type
@@ -142,8 +134,6 @@ Const
 
        TPaymentTime = (ptEndOfPeriod,ptStartOfPeriod);
 
-       EInvalidArgument = class(ematherror);
-
        TValueRelationship = -1..1;
 
     const
@@ -876,22 +866,6 @@ function copysign(x,y: float): float; forward;    { returns abs(x)*sign(y) }
 { include cpu specific stuff }
 {$i mathu.inc}
 
-ResourceString
-  SMathError = 'Math Error : %s';
-  SInvalidArgument = 'Invalid argument';
-
-Procedure DoMathError(Const S : String);
-begin
-  Raise EMathError.CreateFmt(SMathError,[S]);
-end;
-
-Procedure InvalidArgument;
-
-begin
-  Raise EInvalidArgument.Create(SInvalidArgument);
-end;
-
-
 function Sign(const AValue: Integer): TValueSign;inline;
 
 begin
@@ -1749,8 +1723,6 @@ operator ** (base,exponent : int64) res: int64;
 begin
   if exponent<0 then
     begin
-      if base<=0 then
-        raise EInvalidArgument.Create('Non-positive base with negative exponent in **');
       if base=1 then
         res:=1
       else

+ 1 - 1
tests/webtbs/tw12214.pp

@@ -1,7 +1,7 @@
 {$mode objfpc}
 program test_raise;
 
-uses Math;
+uses Math, SysUtils;
 
 var
   X, Y: double;