|
@@ -52,15 +52,7 @@ unit Math;
|
|
{$ENDIF FPC_DOTTEDUNITS}
|
|
{$ENDIF FPC_DOTTEDUNITS}
|
|
interface
|
|
interface
|
|
|
|
|
|
-
|
|
|
|
{$ifndef FPUNONE}
|
|
{$ifndef FPUNONE}
|
|
-{$IFDEF FPC_DOTTEDUNITS}
|
|
|
|
- uses
|
|
|
|
- System.SysUtils;
|
|
|
|
-{$ELSE FPC_DOTTEDUNITS}
|
|
|
|
- uses
|
|
|
|
- sysutils;
|
|
|
|
-{$ENDIF FPC_DOTTEDUNITS}
|
|
|
|
|
|
|
|
{$IFDEF FPDOC_MATH}
|
|
{$IFDEF FPDOC_MATH}
|
|
Type
|
|
Type
|
|
@@ -142,8 +134,6 @@ Const
|
|
|
|
|
|
TPaymentTime = (ptEndOfPeriod,ptStartOfPeriod);
|
|
TPaymentTime = (ptEndOfPeriod,ptStartOfPeriod);
|
|
|
|
|
|
- EInvalidArgument = class(ematherror);
|
|
|
|
-
|
|
|
|
TValueRelationship = -1..1;
|
|
TValueRelationship = -1..1;
|
|
|
|
|
|
const
|
|
const
|
|
@@ -876,22 +866,6 @@ function copysign(x,y: float): float; forward; { returns abs(x)*sign(y) }
|
|
{ include cpu specific stuff }
|
|
{ include cpu specific stuff }
|
|
{$i mathu.inc}
|
|
{$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;
|
|
function Sign(const AValue: Integer): TValueSign;inline;
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -1749,8 +1723,6 @@ operator ** (base,exponent : int64) res: int64;
|
|
begin
|
|
begin
|
|
if exponent<0 then
|
|
if exponent<0 then
|
|
begin
|
|
begin
|
|
- if base<=0 then
|
|
|
|
- raise EInvalidArgument.Create('Non-positive base with negative exponent in **');
|
|
|
|
if base=1 then
|
|
if base=1 then
|
|
res:=1
|
|
res:=1
|
|
else
|
|
else
|