RTL: Sqrt & Pow
This commit is contained in:
@@ -123,54 +123,54 @@ type
|
||||
|
||||
// --- Math Functions ---
|
||||
|
||||
[TRtlExport('Abs', Pure)]
|
||||
[TRtlExport('abs', Pure)]
|
||||
[AstDoc('Returns the absolute value of a number.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Abs(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Round', Pure)]
|
||||
[TRtlExport('round', Pure)]
|
||||
[AstDoc('Rounds a float to the nearest integer.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Round(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Trunc', Pure)]
|
||||
[TRtlExport('trunc', Pure)]
|
||||
[AstDoc('Returns the integer part of a float.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Trunc(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Ceil', Pure)]
|
||||
[TRtlExport('ceil', Pure)]
|
||||
[AstDoc('Returns the smallest integer >= the argument.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Ceil(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Floor', Pure)]
|
||||
[TRtlExport('floor', Pure)]
|
||||
[AstDoc('Returns the largest integer <= the argument.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Floor(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Sign', Pure)]
|
||||
[TRtlExport('sign', Pure)]
|
||||
[AstDoc('Returns -1 for negative, 1 for positive, 0 for zero.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Sign(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Sqrt', Pure)]
|
||||
[TRtlExport('sqrt', Pure)]
|
||||
[AstDoc('Returns the square root of a number.')]
|
||||
[AstSignature('(number) -> number')]
|
||||
class function Sqrt(const Arg: TScalar): TScalar; static;
|
||||
|
||||
[TRtlExport('Pow', Pure)]
|
||||
[TRtlExport('pow', Pure)]
|
||||
[AstDoc('Returns Base raised to the power of Exponent.')]
|
||||
[AstSignature('(number, number) -> number')]
|
||||
class function Pow(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
// --- DateTime ---
|
||||
|
||||
[TRtlExport('Now', Impure)]
|
||||
[TRtlExport('now', Impure)]
|
||||
[AstDoc('Returns the current system timestamp.')]
|
||||
[AstSignature('() -> datetime')]
|
||||
class function Now(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
[TRtlExport('Date', Impure)]
|
||||
[TRtlExport('date', Impure)]
|
||||
[AstDoc('Returns the current date or constructs a date from Y, M, D.')]
|
||||
[AstSignature('() -> datetime')]
|
||||
[AstSignature('(number, number, number) -> datetime')]
|
||||
@@ -178,27 +178,27 @@ type
|
||||
|
||||
// --- Functional / Series ---
|
||||
|
||||
[TRtlExport('Memoize', Pure)]
|
||||
[TRtlExport('memoize', Pure)]
|
||||
[AstDoc('Creates a memoized version of a function for performance.')]
|
||||
[AstSignature('((any) -> any) -> ((any) -> any)')]
|
||||
class function Memoize(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
[TRtlExport('Map', Pure)]
|
||||
[TRtlExport('map', Pure)]
|
||||
[AstDoc('Applies a function to every element of a series.')]
|
||||
[AstSignature('(series, (any) -> any) -> series')]
|
||||
class function Map(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
[TRtlExport('Reduce', Pure)]
|
||||
[TRtlExport('reduce', Pure)]
|
||||
[AstDoc('Collapses a series into a single value using a reducer function.')]
|
||||
[AstSignature('(series, any, (any, any) -> any) -> any')]
|
||||
class function Reduce(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
[TRtlExport('Where', Pure)]
|
||||
[TRtlExport('where', Pure)]
|
||||
[AstDoc('Filters a series based on a predicate function.')]
|
||||
[AstSignature('(series, (any) -> boolean) -> series')]
|
||||
class function Where(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
|
||||
[TRtlExport('Any', Pure)]
|
||||
[TRtlExport('any', Pure)]
|
||||
[AstDoc('Returns true if at least one element satisfies the predicate.')]
|
||||
[AstSignature('(series, (any) -> boolean) -> boolean')]
|
||||
class function Any(const Args: TArray<TDataValue>): TDataValue; static;
|
||||
@@ -324,31 +324,31 @@ type
|
||||
[TRtlExport('not', Pure)]
|
||||
class function Not_Ordinal_Ordinal(A: Int64): Int64; static;
|
||||
|
||||
[TRtlExport('Abs', Pure)]
|
||||
[TRtlExport('abs', Pure)]
|
||||
class function Abs_Ordinal_Ordinal(A: Int64): Int64; static;
|
||||
[TRtlExport('Abs', Pure)]
|
||||
[TRtlExport('abs', Pure)]
|
||||
class function Abs_Float_Float(A: Double): Double; static;
|
||||
[TRtlExport('Round', Pure)]
|
||||
[TRtlExport('round', Pure)]
|
||||
class function Round_Ordinal_Ordinal(A: Int64): Int64; static;
|
||||
[TRtlExport('Round', Pure)]
|
||||
[TRtlExport('round', Pure)]
|
||||
class function Round_Float_Ordinal(A: Double): Int64; static;
|
||||
[TRtlExport('Trunc', Pure)]
|
||||
[TRtlExport('trunc', Pure)]
|
||||
class function Trunc_Ordinal_Ordinal(A: Int64): Int64; static;
|
||||
[TRtlExport('Trunc', Pure)]
|
||||
[TRtlExport('trunc', Pure)]
|
||||
class function Trunc_Float_Ordinal(A: Double): Int64; static;
|
||||
|
||||
[TRtlExport('Sqrt', Pure)]
|
||||
[TRtlExport('sqrt', Pure)]
|
||||
class function Sqrt_Ordinal_Float(A: Int64): Double; static;
|
||||
[TRtlExport('Sqrt', Pure)]
|
||||
[TRtlExport('sqrt', Pure)]
|
||||
class function Sqrt_Float_Float(A: Double): Double; static;
|
||||
|
||||
[TRtlExport('Pow', Pure)]
|
||||
[TRtlExport('pow', Pure)]
|
||||
class function Pow_Ordinal_Ordinal_Float(A, B: Int64): Double; static;
|
||||
[TRtlExport('Pow', Pure)]
|
||||
[TRtlExport('pow', Pure)]
|
||||
class function Pow_Float_Float_Float(A, B: Double): Double; static;
|
||||
[TRtlExport('Pow', Pure)]
|
||||
[TRtlExport('pow', Pure)]
|
||||
class function Pow_Ordinal_Float_Float(A: Int64; B: Double): Double; static;
|
||||
[TRtlExport('Pow', Pure)]
|
||||
[TRtlExport('pow', Pure)]
|
||||
class function Pow_Float_Ordinal_Float(A: Double; B: Int64): Double; static;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user