This commit is contained in:
Mikhalkovich Stanislav 2026-01-27 22:15:23 +03:00
commit 333201895f
4 changed files with 35 additions and 6 deletions

View file

@ -96,7 +96,7 @@
<p><code><strong>var</strong> a := Arr(1,3,5,7,8);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// array of integer<br><strong>var</strong> s :=
Arr('Иванов','Петров','Сидоров'); // array of string<br><strong>var</strong>
b := ArrFill(777,5);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
b := ArrFill(5,777);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// b = [777,777,777,777,777]<br><strong>var</strong> r := ArrRandom(10);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// заполнение 10 случайными целыми в диапазоне от 0 до 100&nbsp; </code></p>
</blockquote>

View file

@ -1777,7 +1777,7 @@ function Sign(x: real): integer;
///--
function Sign(x: BigInteger): integer;
///-function Abs(x: число): число;
/// Возвращает модуль числа x
/// Возвращает модуль числа
function Abs(x: shortint): shortint;
///--
function Abs(x: smallint): smallint;

View file

@ -91,12 +91,25 @@ function !format(val: real; fmt: string): string;
//function any<T>(seq: sequence of T): boolean;
// Standard Math functions
//------------------------------------
// Standard Math functions
//------------------------------------
/// Возвращает абсолютное значение числа
function abs(x: integer): integer;
/// Возвращает абсолютное значение числа
function abs(x: real): real;
/// Возвращает результат и остаток от целочисленного деления
function divmod(a,b: integer): (integer,integer);
/// Возвращает x в степени y
function pow(x,y: real): real;
/// Возвращает x в целой степени n
function pow(x: real; n: integer): real;
/// Возвращает x в целой степени n
function pow(x: BigInteger; n: integer): BigInteger;
// function floor(x: real): real;
type list<T> = class(IEnumerable<T>)
@ -651,10 +664,23 @@ end;
//function any<T>(seq: sequence of T): boolean := seq.Any(x -> x);
function abs(x: integer): integer := if x >= 0 then x else -x;
//------------------------------------
// Standard Math functions
//------------------------------------
function abs(x: integer): integer := if x >= 0 then x else -x;
function abs(x: real): real := PABCSystem.Abs(x);
function divmod(a,b: integer): (integer,integer)
:= (a div b, a mod b);
// divmod вещественный аналог надо реализовать на питоне бы
function pow(x,y: real): real := PABCSystem.Power(x,y);
function pow(x: real; n: integer): real := PABCSystem.Power(x,n);
function pow(x: BigInteger; n: integer): BigInteger := PABCSystem.Power(x,n);
function len<T>(lst: list<T>): integer := lst.!count;
function len<T>(st: &set<T>): integer := st.!count;
function len<K, V>(dct: dict<K, V>): integer := dct.!count;

View file

@ -15,4 +15,7 @@ def print(*args: obj, **kwargs: str):
if len(args) != 0:
pas_print(args[len(args) - 1])
pas_print(end)
pas_print(end)
#def divmod(a: int, b: int) -> (int,int)
# := (a // b, a % b);